Collabify – everyone curates the party playlist
May 10, 2012 § Leave a Comment
Last night was the first Music/Tech meetup. It went really well and we had a blast. Lots of interesting folks came down, we had a few drinks, we had a good chat. It was fun. Why am I telling you about this on the Logical Friday technical blog? Because the way we decided to play music is quite interesting.
Because this was the Music/Tech meetup, we had to have music playing, and it had to be done in a needlessly complicated way. To that end, we decided to take a crack at making the playlist selection more egalitarian. Enter Collabify.
The idea was simple – one Spotify playlist, many people adding to it. Now, I appreciate this is already a solved problem – Spotify has had collaborative playlists for ages. However, we didn’t want everyone having to have their laptops open or go and mess with the laptop connected to the PA. Instead we made a mobile-optimized web interface that would allow you to search for and add songs, and a Spotify app to grab peoples requests and put them into a playlist.
How it works
Collabify consists of two main parts, the client and the server. I’ll talk about the server first.
The server is a super simple Sinatra app. It throws up a web page with a search field, accepts the query and uses the Spotify Metadata API to find a list of results. Once the user clicks “add” on a result, we save the Artist, Title and URI values into a Redis list as a JSON encoded string. It’s quick, it’s easy. It runs on Heroku.
The client is also super simple. Using the Spotify Apps API, we create a playlist in the main Spotify application (terminology here can get confusing). We then make an AJAX call to the server for the JSON stored in Redis. For each item in the list we get back, we instantiate a track and pop it in the playlist. After our initial setup, we run this fetch-instantiate-populate loop every 20 seconds or so, except on these subsequent runs, we trim the results so we only instantiate new additions.
How did it go?
Well! Aside from a little trouble with the venue WiFi, Collabify was a great success. People had fun adding songs to the playlist, Collabify itself proved to be an excellent conversation piece and most importantly nothing crashed!
We projected the client up on the wall so everyone could see what was in the queue. Here is a ropey picture of it in action:
For something conceived in the pub and built in a few snatched hours, I think that’s a pretty good result. Checkout the playlist we made.
Both the Collabify server and Collabify client are open source and available for you to have a play with. Be warned though it’s still held together with string and selotape and should not be considered production software in any way, shape or form!
Did you come to the meetup? Did you add tracks? What were your thoughts?