Last.fm API libary for Erlang
Erlang
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ebin
src
Emakefile
Makefile
README

README

A Last.fm API libary for Erlang

Mostly a proof of concept but still usable.

fermal uses Last.fm's JSON output format and LShift's rfc4627 library/parser thingy.

This code is available as Open Source Software under the MIT license.

Details:

http://www.lshift.net/blog/2007/02/17/json-and-json-rpc-for-erlang
http://www.last.fm/api/

Example Usage:

1> fermal:start().
ok
2>  fermal:artist_info("animal%20collective").
[[artist,
  {name,"Animal Collective"},
  {mbid,"0c751690-c784-4a4f-b1e4-c1de27d47581"},
  {url,"http://www.last.fm/music/Animal+Collective"},
  {steamable,"1"},
  {listeners,"382527"},
  {playcount,"16240956"}],
	<snip>
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      "}]
4> fermal:tasteometer("USERNAME1", "USERNAME2").
[[result,{score,"0.98008804573955"}],
 [user,
  {name,"joanofarctan"},
  {url,"http://www.last.fm/user/joanofarctan"},
  {name,"mirandason"},
  {url,"http://www.last.fm/user/mirandason"}],
 [artists,
  [{name,"The Beatles"},
   {url,"http://www.last.fm/music/The+Beatles"}],
  [{name,"Bj\303\266rk"},
   {url,"http://www.last.fm/music/Bj%C3%B6rk"}],
  [{name,"Iron & Wine"},
   {url,"http://www.last.fm/music/Iron%2B%2526%2BWine"}],
  [{name,"Cat Power"},
   {url,"http://www.last.fm/music/Cat+Power"}],
  [{name,"PJ Harvey"},
   {url,"http://www.last.fm/music/PJ+Harvey"}],
  {matches,"60"}]]
2> fermal:venue_search("arena").
[[results,{searchterms,"arena"},{totalresults,"1354"}],
 [venuematches,
  [{id,"8778545"},
   {name,"Arena"},
   {url,"http://www.last.fm/venue/8778545"},
   location,
   {geopoint,{geolat,"48.187532"},{geolong,"16.413379"}},
   {city,"Wien"},
   {country,"Austria"},
   {street,"Baumgasse 80"},
   {postalcode,"1030"}],
  [{id,"8779138"},
   {name,"Arena"},
   {url,"http://www.last.fm/venue/8779138"},
   location,
   {geopoint,{geolat,"59.3666667"},{geolong,"13.5"}},
   {city,"Karlstad"},
   {country,"Sweden"},
   {street,"Kungsgatan 18"},
   {postalcode,"65224"}],
  [{id,"8779309"},
   {name,"Arena"},
   {url,"http://www.last.fm/venue/8779309"},
   location,
   {geopoint,{geolat,"52.6166667"},{geolong,"10.0833333"}},
   {city,"Celle"},
   {country,"Germany"},
   {street,[]},
   {postalcode,[]}]]]