Flickr::Photoset - Represents a photoset on Flickr.
Version 0.03
use Flickr::Photoset; my $photoset = Flickr::Photoset->new($flickr_api_key); if ($photoset->id({id => 12345678})) { my $title = $photoset->title; my $owner = $photoset->owner; }
This class represents a photoset on Flickr. It uses the Flickr::API::Photosets class (and other's it finds necessary) in order to retrieve and send information to/from Flickr regarding a photoset.
The class tries to be well behaved and Flickr-server-friendly by using lazy data fetching and caching techniques.
The methods that are available are read/write when the item is alterable via the Flickr API. What that means is that if you call a method with an argument it will set that value while if you call it without any arguments it will give you the current value.
Nevertheless do read on the descriptions of each method for more information on it's usage.
IMPORTANT NOTE: So far the above statement about the methods being read/write is wishfull thinking as I've only implemented the read funcionality. Write is coming soon.
Sets up the structure for usage.
$photoset = Flickr::Photoset->new($my_flickr_api_key, $my_flickr_email, $my_flickr_password);
The 'my_flickr_email' and 'my_flickr_password' are optional. See the method 'authenticate' for further explanation.
Some interactions with flickr do require an authenticated user and some information is only accessible in this way and for those calls to be successfull you must provide these parameters. For everything else you really don't need them.
This method provides a way for the user to authenticate on all future calls.
This authentication data may also be provided via the new method.
$person->authenticate({ email => $my_flickr_email, password => $my_flickr_password});
This method has two distinct behaviours depending on whether you call it with or without a parameter.
If you call it without any params it just gives you back the ID of the photoset it is currently representing (assuming there is one photoset being represented at this time).
$id = $p->id;
On the other hand, if you call it with a parameter it assumes you wish to represent the photoset whose ID you just passed in and resets itself accordingly, deleting any data it might have had from a previous photoset, and gets the basic information on the photoset you requested.
$ok = $p->id($photoset_id);
Always returns undef on error. Also on error the $p->{error} structure will be defined.
Returns the title of the photoset.
$title = $p->title;
Returns the description of the photoset.
$description = $p->description;
Returns the secret of the photoset (if you have access to it).
$secret = $p->secret;
Returns the ID of the primary photo in this photoset.
$primary = $p->primary;
Returns the number of photos in this photoset.
$num_photos = $p->num_photos;
Returns a Flickr::Person object representing the owner of this photoset.
$person = $p->owner;
Returns as array of Flickr::Photo objects, representing the photos that belong to this photoset.
$photos = $p->photos;
Internal method used for reseting the data on the user currently instantiated photoset.
Internal method used for reseting the error information on the last method call.
Internal method used to setup the Flickr::API::Photosets object.
Internal method used to parse the result from the Flickr::API::Photosets::getInfo method and fill in our data with it's results.
Internal method used to parse the result from the Flickr::API::Photosets::getContext method and fill in our data with it's results.
Internal method used to parse the result from the Flickr::API::Photosets::getPhotos method and fill in our data with it's results.
Nuno Nunes, <nfmnunes@cpan.org>
<nfmnunes@cpan.org>
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.
<http://www.flickr.com/>, Flickr::Person, Flickr::Photo
To install Flickr::Photo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Flickr::Photo
CPAN shell
perl -MCPAN -e shell install Flickr::Photo
For more information on module installation, please visit the detailed CPAN module installation guide.