Friday, April 17, 2009

Fancy Setlist Bookmarklet for Last.fm Users

Today, I was doing some administration of our feedback forum. First of all, it's great to get your feedback and suggestions! Thanks, you all rock! Please keep on suggesting your ideas. We'll try really hard to get your ideas into our site. We're sorry that we only completed 2 ideas so far. The reason is that we are currently working on a new project - top secret, but we'll let you know ;)

I felt really bad when I had to decline a suggestion - sorry for that, really. However, this idea inspired me to create a cool bookmarklet for all last.fm users out there. Clicking this bookmarklet on a last.fm event page (e.g. The Kooks in Munich) will take you to the setlist on setlist.fm - and import it, if the event is in the past and doesn't exist yet.

Simply drag and drop this link to your bookmarks and try it yourself: Last2Setlist

3 comments:

yomismamente said...

cool!

Jamie said...

Just tried out your bookmarklet, that is awesome, I'd be very interested to know from a programming perspective how that works as that is very, very nice

Stefan Fußenegger said...

Hi Jamie,

from a programming perspective:

Bookmarklet:
1) The bookmarklet extracts Last.fm's event id from the current page's URL
2) The browser is redirect to http://www.setlist.fm/redirect?lastfm=${lastFmId} (where ${lastFmId} is replaced with the extracted event id)

Server:
3) The lastfm parameter is used to search a setlist from the DB
4) if this setlist doesn't exist, the event is imported using Last.fm's API. (This is exactly the same as the Last'fm past-events-import feature)
5) the server sends a redirect to the (newly imported) setlist view page

I think that's more or less everything involved.

Cheers, Stefan