NAME

Net::Spotify::Service - Perl interface to the Spotify Metadata API

VERSION

Version 0.03

SYNOPSIS

# in your subclass
use base 'Net::Spotify::Service';

# the only required method to define in the subclass
# is format_request, which should return an HTTP::Request
# object
sub format_request {
    my ($self, @parameters) = @_;

    # build the URI here
    my $uri = URI->new( ... );

    return HTTP::Request->new('GET', $uri);
}

DESCRIPTION

This module is not intended to be used alone, but as a base for subclasses that implement a specific Spotify service. The two currently available services are lookup and search.

https://developer.spotify.com/technologies/web-api/.

METHODS

new

Class constructor.

base_url

Accessor for the base URL of the Spotify API endpoint. Returns http://ws.spotify.com.

format

Accessor for the format of the responses. Currently only XML is supported and is only used by the search service. Returns xml.

format_request

Builds the request used by make_request(). This method must be defined in the subclasses. It must return an HTTP::Request object.

Parameters

@parameters

All the parameters passed from make_request().

make_request

Makes the real request to the Spotify Metadata API and handles the response. Returns the XML content in case of success or the error code and string in case of error.

Parameters

@parameters

The parameters that must be parsed and used to build the request. See format_request() defined in the subclasses.

ua

Accessor to the LWP::UserAgent object used for making the requests.

version

Accessor to the Spotify service version, currently '1'.

SEE ALSO

Net::Spotify, Net::Spotify::Lookup, Net::Spotify::Search

AUTHOR

Edoardo Sabadelli, <edoardo at cpan.org>

BUGS

Please report any bugs or feature requests to bug-net-spotify at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Spotify. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::Spotify

You can also look for information at:

ACKNOWLEDGEMENTS

This product uses a SPOTIFY API but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group.

COPYRIGHT & LICENSE

Copyright 2009 Edoardo Sabadelli, all rights reserved.

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