Flickr::License - Represents the license of a photo from Flickr


Flickr-License documentation  | view source Contained in the Flickr-License distribution.

Index


NAME

Top

Flickr::License - Represents the license of a photo from Flickr

VERSION

Top

Version 0.02

SYNOPSIS

Top

        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

Top

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

Top

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

Top

Billy Abbott, <billy@cowfish.org.uk>

COPYRIGHT & LICENSE

Top

SEE ALSO

Top

<http://www.flickr.com/>, Flickr::API, Flickr::Photo


Flickr-License documentation  | view source Contained in the Flickr-License distribution.