Archives
Tags
- General (18)
- Food (1)
- Cooking (1)
- Ruby (6)
- Rails (2)
- Svn (2)
- Linux (9)
- Git (1)
- Firefox (8)
- Porn (1)
- Freyja (1)
- Witchhammer (6)
- Music (1)
- Merb (3)
- Poetry (0)
- Bolverk (3)
- Sinatra (1)
- Discogs (1)
- Centos (1)
- Python (1)
- Whinging (2)
- Travel (2)
- Scheme (7)
- Lisp (8)
- Sicp (1)
- Rot13 (1)
- Czech (2)
- Metal (3)
- Passenger (1)
- Fun (5)
- Fractals (2)
- Plt (2)
- Clojure (1)
- Continuations (1)
- Javascript (1)
- Presentation (1)
A Ruby wrapper for the Discogs.com API
I recently noticed that Discogs.com, a huge discographies database, had released their API in the public domain. I think this is a really nice offering, especially considering effective use of the Ebay API can cost in excess of $50,000 per year...
Unfortunately, I couldn't really think of anything useful to do with the information. So instead I've spent the last few weeks writing a 100% Ruby wrapper for version 1.0 of the API. It abstracts all of the tedious work of handling requests/responses, parsing the XML, etc. This way, if someone else has a good idea (or I have one in the future), most of the work will already be done!
Anyway, enough of that. The specifics:
Support
The library currently supports everything in version 1.0 of the API as documented (sort of) on the Discogs website. Namely:
- Artists
- Releases
- Labels
- Searching (all of the above
Installation
I've setup the library as a gem so installation is as easy as:
$ gem sources -a http://gems.github.com $ sudo gem install buntine-discogs
Usage
Here is a small taste of what you can do:
require 'rubygems'
require 'discogs'
wrapper = Discogs::Wrapper.new("my_api_key")
artist = wrapper.get_artist("Master's Hammer")
release = wrapper.get_release("611973") # Supply an ID.
artist.name # => Master's Hammer
artist.releases[0].title # => Finished
artist.releases[1].year # => 1989
artist.releases[4].extraartists # => [ "Arakain", "Debustrol" ]
release.title # => "Ritual"
release.labels[0].name # => "Osmose Productions"
release.formats[0].descriptions[0] # => "LP"
release.styles # => [ "Black Metal", "Death Metal" ]
release.tracklist[1].title # => "Pad modly"Finding out more
I have setup the repository at github. Please let me know of any bugs/problems you find. I'm open to suggestions for improvement, also. Fork me!
On the wiki at github, I have setup a bunch of examples and some documentation for each resource.