Flickr::License::Helper - Helper class to grab details of the currently supported licenses on Flickr
Version 0.02
my $helper = Flickr::License::Helper->get_instance($APIKEY); my $license_name = $helper->licenses->{$license_id}{name}; my $license_url = $helper->licenses->{}$license_id}{url};
The class is a singleton that caches the data returned by the flickr.photo.getLicenses api call in a simple hash.
It only grabs the data when the API key is set or changed, or if the refresh function is explicitly called.
Returns the current api_key. If an argument is passed in that is set to be the current api_key.
If the key has changed then the license data is refreshed from flickr
Refreshes the internal cache from flickr
Returns a handle to the internal cache of licenses. The structure should look something like this:
{ '6' => { 'url' => 'http://creativecommons.org/licenses/by-nd/2.0/', 'name' => 'Attribution-NoDerivs License' }, '1' => { 'url' => 'http://creativecommons.org/licenses/by-nc-sa/2.0/', 'name' => 'Attribution-NonCommercial-ShareAlike License' }, '4' => { 'url' => 'http://creativecommons.org/licenses/by/2.0/', 'name' => 'Attribution License' }, '3' => { 'url' => 'http://creativecommons.org/licenses/by-nc-nd/2.0/', 'name' => 'Attribution-NonCommercial-NoDerivs License' }, '0' => { 'url' => '', 'name' => 'All Rights Reserved' }, '2' => { 'url' => 'http://creativecommons.org/licenses/by-nc/2.0/', 'name' => 'Attribution-NonCommercial License' }, '5' => { 'url' => 'http://creativecommons.org/licenses/by-sa/2.0/', 'name' => 'Attribution-ShareAlike License' } }
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.