Flickr::API - Perl interface to the Flickr API
use Flickr::API; my $api = Flickr::API->new({ 'key' => 'your_api_key', 'secret' => 'your_app_secret', 'unicode'=> 0, }); my $response = $api->execute_method('flickr.test.echo', { 'foo' => 'bar', 'baz' => 'quux', });
or
use Flickr::API; use Flickr::API::Request; my $api = Flickr::API->new({'key' => 'your_api_key'}); my $request = Flickr::API::Request->new({ 'method' => 'flickr.test.echo', 'args' => {}, }); my $response = $api->execute_request($request);
A simple interface for using the Flickr API.
Flickr::API is a subclass of LWP::UserAgent, so all of the various proxy, request limits, caching, etc are available.
Flickr::API
new({ opt => 'value', ... })
Returns as new Flickr::API object. The options are as follows:
key
Your API key
secret
Your API key's secret
rest_uri
auth_uri
Override the URIs used for contacting the API.
lwpobj
Base the Flickr::API on this object, instead of creating a new instance of LWP::UserAgent. This is useful for using the features of e.g. LWP::UserAgent::Cached.
unicode
This flag controls whether Flicrk::API expects you to pass UTF-8 bytes (unicode=0, the default) or actual unicode strings (unicode=1) in the request.
execute_method($method, $args)
Constructs a Flickr::API::Request object and executes it, returning a Flickr::API::Response object.
execute_request($request)
Executes a Flickr::API::Request object, returning a Flickr::API::Response object. Calls are signed if a secret was specified when creating the Flickr::API object.
request_auth_url($perms,$frob)
Returns a URI object representing the URL that an application must redirect a user to for approving an authentication token.
For web-based applications $frob is an optional parameter.
Returns undef if a secret was not specified when creating the Flickr::API object.
Copyright (C) 2004-2013, Cal Henderson, <cal@iamcal.com>
Auth API patches provided by Aaron Straup Cope
Subclassing patch from AHP
Flickr::API::Request, Flickr::API::Response, XML::Parser::Lite, http://www.flickr.com/, http://www.flickr.com/services/api/ https://github.com/iamcal/perl-Flickr-API
To install Flickr::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Flickr::API
CPAN shell
perl -MCPAN -e shell install Flickr::API
For more information on module installation, please visit the detailed CPAN module installation guide.