WWW::Discogs - get music related information and images
Interface with discogs.com api to get music related information and images.
use WWW:Discogs; my $client = WWW::Discogs->new(apikey => 1234567); # Print all artist images from a search # my $search = $client->search("Ween"); for my $result ($search->exactresults) { if ($result->{type} eq 'artist') { my $artist = $client->artist( $result->{title} ); print $artist->name . "\n"; if ($artist->images) { print join "\n", $artist->images; } } } # Print all the album covers for an artist # my $artist = $client->artist("Ween"); for my ($artist->releases) { my $release = $client->release($_->{id}); if ($release->images) { print $release->title . "\n"; if ($release->primaryimages) { print join "\n", $release->primaryimages; } } }
Create a new instance. Takes a hash which must contain an 'apikey' item. You may also provide an 'apiurl' item to change the url that is queried (default is www.discogs.com).
Returns a Discogs::Search object.
Returns a Discogs::Release object. You can get a $release_id from a search, artist, or label.
Returns a Discogs::Artist object. You can get the exact name of an artist from a search result's title.
Returns a Discogs::Label object. You can get the exact name of a label from a search result's title.
Lee Aylward <lee@laylward.com>
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Discogs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Discogs
CPAN shell
perl -MCPAN -e shell install WWW::Discogs
For more information on module installation, please visit the detailed CPAN module installation guide.