Some eight years ago, I stumbled upon an irreparable ’50s radio and turned it into a Pi-powered audio player.
That is, I gave it a fresh coat of paint and a new grill cloth, and built in two small-ish speakers and an equally small “Class D” amp. The thing’s driven by a Raspberry Pi equipped with the cheapest of USB “sound cards.”
The Pi runs MPD, and, alongside it, mpdscribble, a simple audio scrobbling service. Had it push song data to Last.fm—which I hadn’t used in years—for quite a while. And while that was fun, I ultimately decided to pull the plug. (I mean, “Who even cares?”)
Fast-forward to today, or rather, a month or so ago, when I saw all of the year-end Spotify banners fly by, and thought, “Hey, I could totally do this and retain ownership of my data.”
So, I looked at Libre.fm’s source code—Libre.fm being an open-source but somewhat outdated Last.fm alternative—and drew inspiration from it for a WordPress plugin of my own. (Of course, I later on discovered that such a plugin already existed.)
Luckily, mpdscribble’s config file—found at
/etc/mpdscribble.conf—allows setting the Libre.fm endpoint. Pointed it to my site instead, and … it worked!
Next up was scrobbling from my Windows computer. I vaguely remember Last.fm’s Audioscrobbler plugins for, e.g., Winamp, but those would obviously have Last.fm’s endpoint hardcoded within (and have updated to the newer scrobbling protocol, while my endpoint only accepts the much older 1.2 version).
Anyhow, long story short: I mostly followed this Reddit post and used a hex editor to replace the default endpoint of a somewhat older foobar2000 plugin with my own! (The rest of the post isn’t super relevant.) Had to shorten my URL a bit to make it all fit, but: this, too, ended up working!
So … the result’s up at /listens. I’m still figuring out how to microformat these; don’t think too many parsers support