Building a music matchmaker with last.fm (aka Heavy Lifting Part 2)

Graham Scott on Monday, 12th October, 2009

In my previous blog post, Heavy Lifting (save money – don’t reinvent the wheel), I introduced the concept of Heavy Lifting – using tools provided by specialist websites to introduce functionality into your own as quickly and cheaply as possible.

It’s always easier to explain a concept with an example, so without further ado I present to you The Cubeworks Music Match Maker! Have a play around with it – enter a list of musicians/bands that you like (separated with commas) into the box, then click “match me up” to find the Cubeworks team members that have similar taste. Seeing as we’re a fickle bunch musically, I’ve added a list with a few suggestions in case you’re not getting many matches.

So how is this an example of heavy lifting? Well, if I were to build this undoubtedly useful application from scratch I’d need to perform various tasks:

  1. Ask the Cubeworks team to catalogue their favourite artists
  2. Put the above data somewhere (most likely a database)
  3. Work out an algorithm to calculate a compatibility score based on a list of bands compared to a team member’s list of favourites.
  4. Build an app with a pretty interface to display the data in a graph

That sounds like a lot of work! Even if I took it upon myself to do all of the above, there’s a risk that the Cubeworks team, having slightly more important things to do, wouldn’t provide me with their lists of favourite bands, possibly delaying the project.

This is where last.fm comes in – most of the team here have last.fm accounts, and last.fm automatically catalogues each track that we play on Spotify or iTunes, so bullet point one and two of my above list  are sorted without the team having to do anything more than they are already – i.e. listen to music! last.fm also provides a “tasteometer”, which rates compatibility between users’ charts (favourite bands) and/or lists of bands. That’s bullet point three done and dusted too.

So, all that’s left to do is the fun part – design a pretty interface and hook in to last.fm to get the data. This proved to be incredibly simple – less than 100 lines of javascript to get the data and turn it into an animated graph. The integration work itself took a couple of hours, and the prettification a couple more (with some much-needed help from Jesse, our Senior Designer) . The rest of the build was simple html and css to mark up and format the page. Archimedes once stated “Give me a place to stand and I will move the Earth” – we may not have achieved quite that, but the ratio of reward to effort is comparable from a programming perspective.

I hope you enjoy playing with the app – it’s a contrived example for sure, but a little bit more interesting than a picture or video gallery. If you’ve got any questions about heavy lifting or the last.fm app specifically, then I’d love to hear from you in the comments!

Bookmark and Share

2 Comments

Add your comment

  1. Nice post Graham, I really like that fact that it’s so easy to set up something like this, and the only real limitation is imagination.

    Oct 13 at 10:26 by Jonathan Sewell
  2. Great example of how simple an impressive app can be to produce when you harness a third party service. I’m sure some online dating agencies could make use of the next version of your Music Matchmaker. It could even select the best gig for you to go to on a date!

    Oct 14 at 22:24 by Alex Cowell

Post a comment