Every Song Considered15 Mar 2017 | Posted in side-hustle code
I finally released a little side project. I’ve started so many but just never finished any of them. Either I lost interest, or something changed along the way that made me rethink the idea altogether.
All Songs Considered is a fantastic podcast by the good folks at NPR. I’m a big fan of Bob and Robin and the music they (and others) share on the show. It introduces me to a lot of the music I end up listening to. The show’s blog posts on the NPR site don’t always include music, so I wanted a way to bring all the shows together that contained song lists and provide a consistent way to listen to them.
With the help of the NPR API I was able to easily get a list of the shows and the attributes that go along with each. Apart from having to deal with inconsistencies in the data, a complete list of All Songs shows containing song lists was relatively straightforward to get. The next step was to display the list of songs, with artist and album information and a small image of the album cover. Previewing the song was tricky as this data wasn’t always avaialble.
Spotify to the rescue
With their extensive set of APIs, I was able to get the song preview I was looking for. It would have been great to play the entire song, but for now the preview would do. There was a problem though. There was no common unique identifier between what I was getting from NPR and what I needed to get accurate data from Spotify.
The UPC was my first try, but for some reason, they both use different UPCs to identify albums. I had to resort to searching against the Spotify API with artist, album and song information. In most cases, this method returns accurate results but there are edge cases where it might not. I haven’t seen this behaviour yet.
The Resulting MVP
It’s certainly not going to win any design awards, but does what it’s supposed to.
I am in the process of building some new functionality that will allow you to create Spotify playlists based on selected songs.
Update: July 2017
Given some changes to the NPR API (they’ve deprecated the Stories API), I’ve taken the site down until I get a chance to make the necessary changes.