NAME
Flickr::License - Represents the license of a photo from Flickr
VERSION
Version 0.01
SYNOPSIS
my $license=Flickr::License->new({api_key=>$APIKEY, id=>$license_number});
if ($license->valid) {
my $license_name = $license->name;
my $license_url = $license->url;
}
DESCRIPTION
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.
METHODS
new
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.
id
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.
name
Returns the license name
url
Returns the license url
valid
Returns whether the license id was valid. 0=false, 1=true.
AUTHOR
Billy Abbott, <billy@cowfish.org.uk>
COPYRIGHT & LICENSE
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.
SEE ALSO
<http://www.flickr.com/>, Flickr::API, Flickr::Photo