Net::Flickr::Simile::Exhbit - OOP for generating Simile Exhibit files using the Flickr API
use Getopt::Std; use Config::Simple; use Net::Flickr::Simile::Exhibit; my %opts = (); getopts('c:j:h:t:', \%opts); my $cfg = Config::Simple->new($opts{'c'}); my %args = ('exhibit_json' => $opts{'j'}, 'exhibit_html' => $opts{'h'}, 'tags' => $opts{'t'}); my $fl = Net::Flickr::Simile::Exhibit->new($cfg); $fl->search(\%args); # So then you might do : # perl ./myscript -c /my/flickr.cfg -h ./mystuff.html -j ./mystuff.js -t kittens
OOP for generating Simile Exhibit files using the Flickr API.
Options are passed to Net::Flickr::Backup using a Config::Simple object or a valid Config::Simple config file. Options are grouped by "block".
api_key
String. required
A valid Flickr API key.
api_secret
A valid Flickr Auth API secret key.
auth_token
A valid Flickr Auth API token.
api_handler
The api_handler defines which XML/XPath handler to use to process API responses.
LibXML
Use XML::LibXML.
XPath
Use XML::XPath.
enabled
Boolean.
Default is false.
handler
String.
The default handler is Screen, as in Log::Dispatch::Screen
Log::Dispatch::Screen
handler_args
For example, the following :
reporting_handler_args=name:foobar;min_level=info
Would be converted as :
(name => "foobar", min_level => "info");
The default name argument is "__report". The default min_level argument is "info".
Where $cfg is either a valid Config::Simple object or the path to a file that can be parsed by Config::Simple.
Returns a Net::Flickr::Simile::Exhbit object.
Net::Flickr::Simile::Exhibit subclasses Net::Flickr::Simile and Net::Flickr::API so all of those methods are available to your object. The following methods are also defined.
Valid arguments are anything you would (need to) pass to the flickr.photos.search API method and :
exhibit_json
The path where Exhbit JSON data should be written to disk.
exhibit_html
The path where Exhbit HTML data should be written to disk. It will contain a relative pointer to exhibit_json.
The user_id bound to the Flickr Auth token defined in the object's config file will automatically be added to the method arguments and used to scope the query.
Returns true or false.
Valid arguments are anything you would (need to) pass to the flickr.photos.getContactsPhotos API method and :
Valid arguments are anything you would (need to) pass to the flickr.photos.getContactsPublicPhotos API method and :
Where $rsp is the return value of a call to Net::Flickr::API-api_call>.
Returns a JSON string representing the data in $rsp suitable for including with a Simile Exhibit document.
Returns true or false
0.1
Aaron Straup Cope <ascope@cpan.org>
helper methods
Basically anything that returns a "standard photo response" (or /rsp/photos/photo) from the Flickr API can be used with this package to generate Exhibit data.
As this time, however, only a handful of (API) methods have (Perl) helper methods. There will be others.
pagination
This package does not know how to account for pagination in the Flickr API. That may change over time.
HTML files
This package contains a bare-bones template for generating an HTML file to view your Exhibit data.
You may need to tweak the output after the fact or you can subclass the readExhibitHtml method.
http://aaronland.info/perl/net/flickr/simile/exhibit.html
http://aaronland.info/perl/net/flickr/simile/exhibit.js
Net::Flickr::API
http://simile.mit.edu/exhibit/
Please report all bugs via http://rt.cpan.org/
Copyright (c) 2007 Aaron Straup Cope. All Rights Reserved.
This is free software. You may redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Flickr::Simile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Flickr::Simile
CPAN shell
perl -MCPAN -e shell install Net::Flickr::Simile
For more information on module installation, please visit the detailed CPAN module installation guide.