-
-
30 Nov 2015 18:56:22 UTC
- Distribution: WebService-Audioscrobbler
- Module version: 0.08
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (3)
- Testers (397 / 0 / 0)
- Kwalitee
Bus factor: 0- 41.06% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (10.76KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- CLASS
- Cache::FileCache
- Carp
- Class::Accessor::Fast
- Class::Data::Accessor
- LWP::Simple
- NEXT
- Test::More
- UNIVERSAL::require
- URI
- URI::Escape
- XML::Simple
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
WebService::Audioscrobbler::Base - An object-oriented interface to the Audioscrobbler WebService API
SYNOPSIS
This module implements the base class for all other WebService::Audioscrobbler modules.
package WebService::Audioscrobbler::Subclass; use base 'WebService::Audioscrobbler::Base'; ... my $self = WebService::Audioscrobbler::Subclass->new; # retrieves tracks my @tracks = $self->tracks; # retrieves tags my @tags = $self->tags; # retrieves arbitrary XML data as a hashref, using XML::Simple my $data = $self->fetch_data('resource.xml');
METHODS
tracks
Retrieves the tracks related to the current resource as available on Audioscrobbler's database.
Returns either a list of tracks or a reference to an array of tracks when called in list context or scalar context, respectively. The tracks are returned as WebService::Audioscrobbler::Track objects by default.
tags
Retrieves the tags related to the current resource as available on Audioscrobbler's database.
Returns either a list of tags or a reference to an array of tags when called in list context or scalar context, respectively. The tags are returned as WebService::Audioscrobbler::Tag objects by default.
artists
Retrieves the artists related to the current resource as available on Audioscrobbler's database.
Returns either a list of artists or a reference to an array of artists when called in list context or scalar context, respectively. The tags are returned as WebService::Audioscrobbler::Artist objects by default.
fetch_data($postfix)
This method retrieves arbitrary data from this resource using the specified
$postfix
. This is accomplished by calling thefetch
method of this object's data fetcher object (usually an instance of WebService::Audioscrobbler::DataFetcher).resource_path
This method must be overriden by classes which inherit from
Base
. It should return the relative resource URL which will be used for fetching it from Audioscrobbler.uri_builder
Helps classes which inherit from WebService::Audioscrobbler::Base to build URI objects. Mainly used for keeping
resource_path
code cleaner in those classes.croak
Shortcut for
Carp::croak
which can be called as a method.AUTHOR
Nilson Santos Figueiredo Junior,
<nilsonsfj at cpan.org>
COPYRIGHT & LICENSE
Copyright 2006-2007 Nilson Santos Figueiredo Junior, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install WebService::Audioscrobbler, copy and paste the appropriate command in to your terminal.
cpanm WebService::Audioscrobbler
perl -MCPAN -e shell install WebService::Audioscrobbler
For more information on module installation, please visit the detailed CPAN module installation guide.