
PX::API - Perl interface to the Peekshows Web Services API.

use PX::API;
my $px = PX::API->new({
api_key => '13243432434', #Your api key
secret => 's33cr3tttt', #Your api secret
});
my $response = $px->call('px.test.echo', {
arg1 => 'val1',
arg2 => 'val2',
});

A quick and simple perl interface to the Peekshows Web Services API. PX::API uses LWP::UserAgent for communication via the Peekshows Web Services rest interface. Response formats are made available 'plugin' style to allow for an extensible method of adding response types as they become available through the API.

new($args)Constructs a new PX::API object storing your api_key and secret.
call($method,$args)Calls the specified $method passing along all $args allong with the request. A PX::API::Response object is returned based on the requested format, rest by default. When making authenticated calls, PX::API::do_sign(1) must be called to create a valid api_sig. Will return an error if no secret is present when requiring an api_sig.
execute_request($request)Executes a method call to the API. The $request argument must be a PX::API::Request object.
auth_url($perms)Constructs a url that can be used to send users to the Peekshows auth page. This method will create an api_sig automagically, there is no need to set PX::API::do_sign(1), though a secret is required.

PX::API uses Class::Accessor::Fast as a base, making most parameters available through its simple get/set interface. ie:
my $api_key = $px->api_key
$px->api_key('41234314344')
api_keyThe key you received for your application.
secretThe secret string you received for your application.
methodThen name of the method you wish to call. ie: px.test.echo
argsThe list of arguments to be sent with the call to the API.
do_signThis works as a switch, setting to 0 or 1 will disable or enable call signing respectively.
api_sigThe signature for the last signed API call that was made.
uaThis is the LWP::UserAgent object created during construction. By default the object is created with:
{
agent => "PX::API/$VERSION"
timeout => 60
}

Class::Accessor LWP::UserAgent Digest::MD5

PX::API::Request PX::API::Response http://www.peekshows.com http://services.peekshows.com

Anthony Decena <anthony@1bci.com>

Copyright (c) 2007, Anthony Decena <anthony@1bci.com>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.