January 29, 2009

fermal: a last.fm API library for Erlang.

I decided to start a new project after the relative success and fun I had writing merle. This time I decided to do something a little more web-centric, a library for last.fm’s awesomely complete API called fermal. While I doubt it will eventually support the entire API it will likely support a good portion of it. I recently made the commits and there is already some usable stuff in there. At the moment there is support for getting album info, artist info and using their tasteometer to compare tastes of two last.fm users. fermal uses last.fm’s JSON format API and LShift’s rfc4627 library to do the dirty work. Here is an example of its usage:

3> fermal:album_info(“animal%20collective”, “feels”).
[[album,
{name,"Feels"},
{artist,"Animal Collective"},
{id,"2050717"},
{mbid,"8a9ee208-3c9e-4fec-8f60-9a8b1db39960"},
{url,"http://www.last.fm/music/Animal+Collective/Feels"},
{releasedate," 18 Oct 2005, 00:00"},
{listeners,"184794"},
{playcount,"3539880"},
{toptags,"\n "}]]

2 Comments

  1. Tony Garnock-Jones Feb 04, 2009 8:23 am

    That’s bloody cool! (Pleased to see rfc4627.erl in use, too :-) ) Did you see we built the LShift jukebox out of Erlang and AJAX (http://hg.opensource.lshift.net/erlang-jukebox/)? I’ve got half a scrobbler written in Erlang that I’m dying to integrate with the jukebox — it’d be cool to use your code to pull some last.fm information *back* as well.

  2. joe Feb 04, 2009 11:47 am

    Nice! You are more than welcome to use my code. I have licensed it under the MIT, hopefully that works for you.

Leave a Comment

(required)

(will not be published) (required)