The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Flickr::API::Photosets - The Perl interface to the Flickr API's flickr.photosets.* methods.

VERSION

Version 0.02

SYNOPSIS

  use Flickr::API::Photos;

  my $flickrphotosets = Flickr::API::Photosets->new($my_flickr_api_key);

            
  my $photosets = $flickrphotosets->getList($user_id);
  
  my $photoset_id = $photosets->[0]{id};
  my $photos_list = $flickrphotosets->getPhotos($photoset_id);

DESCRIPTION

This module maps the Flickr API's flickr.photosets.* methods.

Each method from the Flickr API has a counterpart method in this class (the one's I've mapped already, that is).

The mapping is done by placing each unique piece of information (id, owner, title, description, etc) on the main-level hash and everything that may have multiple instances (photos for instance) on a array inside that main hash.

Mainly I've just tried to use common sense when deciding how to map something. Please feel free to send suggestions or insights on this subject.

Under the hood this class uses the Flickr::API class to handle the actual communication with Flickr's servers.

See the flickr API documentation <http://www.flickr.com/services/api> for the full description of each method and it's return values.

METHODS

new

Takes the Flickr API key as the 'key' parameter and sets up the object for further requests.

$flickrphotosets = Flickr::API::Photosets->new($my_flickr_api_key, $my_flickr_email, $my_flickr_password});

The 'my_flickr_email' and 'my_flickr_password' parameters are optional. If you wish to retreive pictures which are not public but are acessible to your account you should pass these parameters along and all further communication with Flickr will be authenticated with this data.

getList

Mapping for the method flickr.photosets.getList which gets the list of photosets for a given user.

$list = $flickrphotosets->getList($user_id);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1, 'cancreate' => 1, 'photosets' => [ { 'photos' => '12', 'id' => '123456', 'title' => 'A Great photoset', 'description' => 'Fabulous pictures all around!', 'secret' => '45ffssd334d', 'server' => '11', 'primary' => '12345678' }, ... ] }

getPhotos

Mapping for the method flickr.photosets.getPhotos which gets the photo list for a given photoset.

$photos = $flickrphotosets->getPhotos($photoset_id);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1, 'id' => '123456', 'primary' => '5554323', 'photos' => [ { 'title' => 'LovelyCat.jpg', 'id' => '5554323', 'server' => '1', 'secret' => 'dsf77sd5f', 'isprimary' => '1' }, ... ] }

getContext

Mapping for the method flickr.photosets.getContext which gets the previous and next photos for a given photo inside a given photoset.

$photos = $flickrphotosets->getContext($photo_id, $photoset_id);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1 'count' => '22', 'nextphoto' => { 'title' => 'Finally arrived!', 'id' => '12345678', 'url' => '/photos/jdoe/12345678/in/set-12345/', 'thumb' => 'http://photos7.flickr.com/12345678_b33fa99a70_s.jpg', 'secret' => 'b33fa99a70' }, 'previousphoto' => { 'title' => 'Nearly there...', 'id' => '12345676', 'url' => '/photos/jdoe/12345676/in/set-12345/', 'thumb' => 'http://photos7.flickr.com/12345676_b33fa93a70_s.jpg', 'secret' => 'b33fa93a70' }, }

getInfo

Mapping for the method flickr.photosets.getInfo which gets the information on the given photoset.

$photos = $flickrphotosets->getInfo($photoset_id);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1, 'title' => 'Teste set', 'owner' => '12345678@N00', 'description' => 'Testing some features of my new super-duper camera.', 'photos' => '16', 'secret' => 'aeb33f3ac0', 'id' => '123456', 'primary' => '851835' }

AUTHOR

Nuno Nunes, <nfmnunes@cpan.org>

BUGS

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

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2005 Nuno Nunes, All Rights Reserved.

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