Net::iTMS::Artist - Represents an artist in the iTunes Music Store
use Net::iTMS::Artist; my $artist = Net::iTMS::Artist->new($iTMS, $id); print "Artist: ", $artist->name, "\n"; # $album will be a Net::iTMS::Album object for my $album ($artist->discography) { print $album->title, " (", $album->genre->name, ")\n"; # $track will be a Net::iTMS::Song object for my $track ($album->tracks) { # also $album->songs print "\t ", $track->number, ": ", $track->title, "\n"; } }
Net::iTMS::Artist represents an artist in the iTMS and encapsulates the associated data. If a piece of information hasn't been fetched from the iTMS, it will transparently fetch and store it for later use before returning.
If one of the methods id, name, website, genre, path, selected_albums, or total_albums is called, the information for the others will be fetched in the same request. This means, for these methods, the first call to one will have a time hit for the HTTP request, but subsequent calls won't.
id
name
website
genre
path
selected_albums
total_albums
All methods return undef on error and (should) set an error message, which is available through the error method. (Unless I note otherwise.)
undef
error
The first argument must be an instance of Net::iTMS, the second an iTMS artist ID.
Returns a blessed hashref (object) for Net::iTMS::Artist.
Returns the ID of the artist (artistId).
artistId
Returns the name of the artist.
Returns the website URL of the artist (undef if there isn't one specified).
Returns a Net::iTMS::Genre object representing the artist's primary genre.
Returns an arrayref of hashrefs representing the artist's "path" in the iTMS. The hashrefs contain the name of the node in the path and the iTMS URL of that node.
For example, Elliott Smith's (id = 2893902) "path" is "Alternative > Elliott Smith", which is represented in Perl by:
# URLs trimmed for example [ { 'url' => 'http://ax.phobos.apple.com.edgesuite.net/.../viewGenre?genreId=20', 'name' => 'Alternative' }, { 'url' => 'http://ax.phobos.apple.com.edgesuite.net/.../viewArtist?artistId=2893902', 'name' => 'Elliott Smith' } ]
This is pretty much only useful if you're trying to imitate the iTunes interface.
Returns an array or arrayref (depending on context) of Net::iTMS::Album objects for a selection of the best selling albums by the artist.
Returns an array or arrayref (depending on context) of Net::iTMS::Album objects for all the albums of the artist available on the iTMS.
Returns an array or arrayref (depending on context) where each element is a paragraph in the artist's iTMS bio.
Options
If this option is set, iTMS links to albums within the bio will be translated into HTML links. The albumId is prepended to the URL passed as the value of the option.
The default is to simply ignore the links, leaving the plain text title.
Returns an array or arrayref (depending on context) of Net::iTMS::Album objects for the albums/artists which influenced the artist, according to the iTMS.
Copyright 2004, Thomas R. Sibley.
You may use, modify, and distribute this package under the same terms as Perl itself.
Thomas R. Sibley, http://zulutango.org:82/
Net::iTMS, Net::iTMS::Album, Net::iTMS::Song, Net::iTMS::Genre
To install Net::iTMS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::iTMS
CPAN shell
perl -MCPAN -e shell install Net::iTMS
For more information on module installation, please visit the detailed CPAN module installation guide.