Lee Aylward > WWW-Discogs-0.02 > WWW::Discogs

Download:
WWW-Discogs-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.02   Source   Latest Release: WWW-Discogs-0.06

NAME ^

WWW::Discogs

DESCRIPTION ^

Interface with discogs.com api

SYNOPSIS use WWW:Discogs; ^

        my $client = WWW::Discogs->new(apikey => 1234567);

        # Print all artist images from a search
        #
        my $results = $client->search("Ween");
        
        for my $result (@$results) {
                if ($result->{type} eq 'artist') {
                        my $artist = $client->artist( $result->{title} );
                        print "$_\n" for @{ $artist->images };
                }
        }

        # Print all the album covers for an artist
        #
        my $artist = $client->artist("Ween");
        for my $releaseid (@{ $artist->releases }) {
                my $release = $client->release($releaseid);
                print "$_\n" for @{ $release->images };
        }

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 )

Do a search using $searchstring. This will return an arrayref of hashes. Each hash has a type (artist, release, or label), title, and optional url and summary.

release( $release_id )

Returns a Discogs::Release object. You can get a $release_id from the releases method of Discogs::Artist or Discogs::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.