Flickr::License - Represents the license of a photo from Flickr
Version 0.02
my $license=Flickr::License->new({api_key=>$APIKEY, id=>$license_number}); if ($license->valid) { my $license_name = $license->name; my $license_url = $license->url; }
This class retrieves data about the currently available Flickr photo licenses and returns the details that Flickr does based on the license number passed in.
The license number can be obtained easily from the Flickr::Photo object using the ->license() call.
If the license number isn't recognised in the data structure that Flickr returns then the "valid" property of the class is set to 0 and the name is set to "Invalid License"
Behind the scenes it uses a singleton that holds the necessary license date, only refreshing itself if it thinks it needs to.
Sets up the license object.
my $license=Flickr::License->new({api_key => $APIKEY, id => $license_id});
id is optional and can be set using the ->id() setter/getter -> details of the license are only filled in once id is set.
my $id = $license->id; my $different_id = $license->id($a_different_id);
Returns the id. Also sets the id if an argument is passed in - it will always return the new id.
Will also populate the object with license information.
Returns the license name
Returns the license url
Returns whether the license id was valid. 0=false, 1=true.
Billy Abbott, <billy@cowfish.org.uk>
<billy@cowfish.org.uk>
Copyright 2007 Billy Abbott, 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::API, Flickr::Photo
To install Flickr::License, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Flickr::License
CPAN shell
perl -MCPAN -e shell install Flickr::License
For more information on module installation, please visit the detailed CPAN module installation guide.