leedo > WWW-Discogs-0.10 > WWW::Discogs

Download:
WWW-Discogs-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.10   Source   Latest Release: WWW-Discogs-0.13

NAME ^

WWW::Discogs - get music related information and images

DESCRIPTION ^

Interface with discogs.com api to get music related information and images.

SYNOPSIS ^

        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;
                        }
                }
        }

METHODS ^

new( %params )

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).

search( $searchstring )

Returns a Discogs::Search object.

release( $release_id )

Returns a Discogs::Release object. You can get a $release_id from a search, artist, or label.

artist( $artist_name )

Returns a Discogs::Artist object. You can get the exact name of an artist from a search result's title.

label( $label_name )

Returns a Discogs::Label object. You can get the exact name of a label from a search result's title.

AUTHOR ^

Lee Aylward <lee@laylward.com>

LICENSE ^

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: