Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 890 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 890 Bytes

rscrobbler

Ruby library for wrapping Last.fm API methods as documented: www.last.fm/api

Getting Started

Install the gem: https://rubygems.org/gems/rscrobbler

gem install rscrobbler

Generate your Last.fm auth token:

generate_lastfm_auth_token

Configure the library with your LastFM credentials:

include 'rscrobbler'
LastFM.establish_session do |session|
  session.api_key    = (see: www.last.fm/api/account)
  session.api_secret = (see: www.last.fm/api/account)
  session.username   = (last.fm username)
  session.auth_token = (auth token from generate_lastfm_auth_token)
end

Once authenticated, call API methods using the following syntax:

LastFM::Track.scrobble( artist:'Childish Gambino', track:'Bonfire', timestamp:Time.now )

See documentation for detailed method and parameter information.