A ruby wrapper for the Spotify Metadata API. See here for usage: http://developer.spotify.com/en/metadata-api/overview/
Use of the API is subject to the Terms and Conditions: http://developer.spotify.com/en/metadata-api/terms-of-use/
gem install -spotify
The API has two services for the three types of data, artists, albums and tracks:
To look up an artist, album or track, simply call:
artist = ::.("spotify:artist:4YrKBkKSVeqDamzBPWVnSJ") #=> #<MetaSpotify::Artist:0x119764c @name="Basement Jaxx"> artist.name #=> "Basement Jaxx"
You can also call lookup with the extras parameter, but only the acceptable extras will yield results, e.g.
artist = ::.('spotify:artist:4YrKBkKSVeqDamzBPWVnSJ', :extras => 'album') artist.albums.first.name #=> "Jaxx Unreleased"
To search for an artist, album or track works the same way as lookup, simply call:
search = ::.('foo') search.artists.first.name #=> "Foo fighters"
For searches with many results, the result also contains details on pages and you can return page 2 like this:
::.('foo', :page => 2)
This is very new, so please let me know of any problems or anything that is missing.
Copyright (c) 2009 Phil Nash. See LICENSE for details.