Isnor Creative
Isnor Creative Blog
Ruby, Ruby on Rails, Ember, Elm, Phoenix, Elixir, React, Vue

Jul 13, 2008

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.

Gordon B. Isnor

Gordon B. Isnor writes about Ruby on Rails, Ember.js, Elm, Elixir, Phoenix, React, Vue and the web.
If you enjoyed this article, you may be interested in the occasional newsletter.

I am now available for project work. I have availability to build greenfield sites and applications, to maintain and update/upgrade existing applications, team augmentation. I offer website/web application assessment packages that can help with SEO/security/performance/accessibility and best practices. Let’s talk

comments powered by Disqus