tl;dr “I dont want to read your article, I want to download the code” : Skip to this section of the article for the link to the Github repository.
Lately I started using Last.fm a bit more thoroughly. For those who don’t know what Last.fm is, it’s a webstite that allows you to “scrobble” (log) every song you listen to.
It’s cool because then you can have cool stats about your listening habits, but also discover new artists related to what you like (Spotify largely copied what Last.fm was doing, with the artist/album/song radio and “daily mix” playlists).
I was browsing the website and looking at what my friends were listening to, when suddenly I thought that it would be cool to be able to listen to what another user is listening to, at the same time. It’s a cool way to discover new music while relying on someone’s tastes isntead of the Spotify algorithms, that unfortunately often brings you the same songs that you already know too well.
I started googling, but unfortunately didn’t find anything remotely close to what I was trying to do, except a very old website called “overhere” that apparently did the same thing, but is now long dead.
So I knew I had to do it myself.
After a few moments researching the Last.fm API and the Spotify API, I came to the conclusion it should be doable and reasonably easy to do.
I ended up doing it in Python, since it makes such little scripts easy and quick to code, and libraries were available to interact with the aforementionned APIs.
Basically, the program checks what a user (of your choice) is listening to on Last.fm, and if he/she is listening to a song, it will search for it on Spotify, and play it, if available. At the end of the song, it does it again. Rinse and repeat.
And voilà, you are listening along a Last.fm user, to the exact same songs, at the same time.
Where to get it ?
You can find the code on this Github repository :
Everything needed is explained in the README.md file.
Have fun discovering new music 🙂