Owning My Scrobbles

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 listen-of.

6 responses to “Owning My Scrobbles”

  1. Johan Bové

    … liked this!

  2. Jan Boddez

    Wondering if I’m able to similarly “hack” Last.fm’s official legacy plugin for, e.g., Winamp. http://forums.winamp.com/showthread.php?t=453688#post3178548

  3. tracydurnell.com

    […] Homebrew Website Club on Wednesday, GWG challenged me to explore owning my scrobbles, pointing me to Jan’s implementation (GitHub). I said I listen to way too much music and I’d need to do a separate WordPress install on a subdomain dedicated to tracking listens, so I ruled it […]

  4. Jan Boddez

    Found myself googling a couple albums tonight, and now I’m thinking a “Last.fm of my own music library” may not be so crazy after all. Like, not just post scrobbles, but have artist/album pages, too, and similar artist recommendations, etc. Bit of genre history, perhaps, and so on.

  5. Wouter Groeneveld

    […] Hack together your own last.fm to scrobble music to your own site: Jan Boddez' Owning My Scrobbles […]

  6. jacky.wtf

    … liked this!