/ Published in: Perl
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/perl -w # To install the Flickr perl library on OSX with macports I do: # sudo port install p5-flickr-api # On Linux there's a similar package. # # Then to get Flickr::Photoset I do: # sudo perl -MCPAN -e 'install Flickr::Photoset' use Data::Dumper; use Flickr::Photoset; use Flickr::Photo; use LWP::Simple; use strict; my $params = { api_key => 'your api key'}; my $info = {}; my $photoset = Flickr::Photoset->new($params); # specify a photoset if ($photoset->id({id => '72057594072478931'})) { my $title = $photoset->title; my $owner = $photoset->owner->real_name; my $photos = $photoset->photos; foreach my $p ( @$photos ) { my $id = $p->id; my $sizes = $p->sizes; foreach my $s (@$sizes) { if ( $s->{'label'} eq 'Original') { $info->{$id} = { source => $s->{'source'}, title => $p->title, server => $p->server }; my $ret = getstore( $s->{'source'}, $p->title.'_'.$id.'.jpg' ); } } } }