LastFM API Plugin For Ruby on Rails
I created my first Rails plugin recently… It provides some easy ways to interact with the LastFM API.
There are generic methods for unauthorized RESTful GET queries, authorized RESTful GET queries, and RESTful POST query, as well as helper methods for generating a redirect path if a session has not been started for a user, and a get session method once LastFM supplies a token and redirect to your callback URL.
Next there are specific methods created for the queries I required for my site. These will return preformatted arrays that are easy to walk through in a view. Methods available:
- lastfm_album_info(artist,album)
- lastfm_artists_info(artist)
- lastfm_artists_current_events(artist,limit)
- lastfm_similar_artists(artist,limit)
- lastfm_artists_top_albums(artist,limit)
- lastfm_artists_top_tracks(artist,limit)
- lastfm_artists_top_tags(artist,limit)
- lastfm_users_weekly_artists(user,limit)
- lastfm_users_weekly_albums(user,limit)
Download it Here or read more at the Git homepage for the plugin
I am available for Ruby on Rails consulting work – get in touch to learn more.