SpotTracks
SpotTracks is an easy way to get spotify play links from your recently played tracks.
Installation
Add this line to your application's Gemfile:
gem 'spot_tracks'
And then execute:
$ bundle
Or install it yourself as:
$ gem install spot_tracks
Usage
SpotTracks pulls your Last.fm RSS feed, and looks up those tracks on Spotify. It returns a json hash with your data:
SpotTracks::Feed.new('mttwrnr').to_json
#=> {
"title":"mttwrnr's Recently Played Tracks",
"url":"http://www.last.fm/user/mttwrnr",
"entries":[{
"title":"Duck Sauce – NRG - Radio Edit",
"urls":{
"lastfm":"http://www.last.fm/music/Duck+Sauce/_/NRG+-+Radio+Edit",
"spotify":"spotify:track:6MbFmc3lDtnlihb7DEabRA"
}
},{
"title":"The Magician – When The Night Is Over - Clancy Remix [feat. Newtimers]",
"urls":{
"lastfm":"http://www.last.fm/music/The+Magician/_/When+The+Night+Is+Over+-+Clancy+Remix+%5Bfeat.+Newtimers%5D",
"spotify":"spotify:track:58ScEoCoWkICs0HD7xHYKI"
}
}]
}
Enjoy!
Contributing
- Fork it ( https://github.com/[my-github-username]/spot_tracks/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request