Skip to content
forked from buntine/discogs

A 100% Ruby wrapper of the Discogs.com API

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

rshepherd/discogs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discogs::Wrapper

ABOUT

A 100% Ruby wrapper of the Discogs.com API. No dependencies, no extra gems. :)

Discogs::Wrapper abstracts all the nasty boilerplate code needed to interact with the Discogs API. It gives you direct access to the information you need.

Full support for everything in version 1.0 of the API:

  • Artists
  • Releases
  • Labels
  • Searching (all of the above)

The API is documented here.

INSTALLATION

You can install the library via Rubygems: $ gem sources -a http://gems.github.com $ sudo gem install buntine-discogs

USAGE

To use this library, you must supply a valid Discogs API key. require 'discogs'

wrapper = Discogs::Wrapper.new("my_api_key")

Accessing information is easy: artist = wrapper.get_artist("Master's Hammer") release = wrapper.get_release("611973") # Supply an ID. label = wrapper.get_label("Monitor Records") search_results = wrapper.search("Necrovore")

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"

label.images[0].width               # => "220"
label.releases.length               # => 22
label.releases[3].artist            # => "Root"
label.releases[7].catno             # => "MON007"

search.total_results                # => 124
search.total_pages                  # => 7
search.current_page                 # => 1

# Exact results
search.exact[0].type                # => "artist"
search.exact[0].title               # => "Necrovore"
search.exact(:label)[0].title       # => "Necrovores Records"
search.closest(:artist)             # => <Discogs::Search::Result:0x324ad3e2>

# All results
search.results[3].title             # => "Necrovore - Demo '87"
search.results[3].summary           # => "First and only demo tape"
search.results(:release)[0]         # => <Discogs::Search::Result:0x343de34a>

About

A 100% Ruby wrapper of the Discogs.com API

Resources

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%