tjc / flickr-api2 Goto Github PK
View Code? Open in Web Editor NEWA fork of Flickr::API from Perl's CPAN
A fork of Flickr::API from Perl's CPAN
Wondering if there is a reason a large portion of elements aren't being returned by the by_id subroutine in the Photos.pm module?
sub by_id {
my ($self, $id) = @_;
my $p = Flickr::API2::Photo->new( api => $self->api, id => $id );
my $info = $p->info->{photo};
$p->title($info->{title}{_content});
$p->description($info->{description}{_content});
$p->owner_name($info->{owner}{realname});
$p->owner_id($info->{owner}{nsid});
$p->path_alias($info->{owner}{username});
return $p;
}
I've modified this (and some portion of Photo.pm) so that I can get some elements I need for a project. Is there another way to get this info that I've missed?:
sub by_id {
my ($self, $id) = @_;
my $p = Flickr::API2::Photo->new( api => $self->api, id => $id );
my $info = $p->info->{photo};
$p->title($info->{title}{_content});
$p->description($info->{description}{_content});
$p->owner_name($info->{owner}{realname});
$p->owner_id($info->{owner}{nsid});
$p->path_alias($info->{owner}{username});
$p->license($info->{license});
$p->tags($info->{tags}{tag});
$p->dates($info->{dates});
return $p;
}
If not, I can tweak it a bit more and submit a pull request.
I'd like to get the total number of pictures retured from a search. I was able to access this (and some other things) in the search subroutine in Photos.pm, however I couldn't figure out how to return them with the photos.
Here's how I could access them:
my $page_info = {
'total' => $r->{photos}->{total},
'page' => $r->{photos}->{page},
'perpage' => $r->{photos}->{perpage},
'pages' => $r->{photos}->{pages},
};
my @results = $self->_response_to_photos($r->{photos});
push( @results, $page_info );
return @results;
This returned an array containing a hash and an array of hashes. I couldn't figure out an elegant way to access the info though.
Please do not die in libraries with die "$message\n"
.
I had a program that failed with API call failed with HTTP status: 403
. The problem was that I was using a number of API calls in this program and it was most unclear as to which API had failed.
I finally tracked it down (with grep) to https://github.com/TJC/Flickr-API2/blob/master/lib/Flickr/API2/Raw.pm#L132-L133
die("API call failed with HTTP status: " . $response->code . "\n")
unless $response->code == 200;
Please either use croak or at least leave out the \n
so that I can see which module failed.
Thanks.
Automatically retry the API HTTP requests to Flickr if they time-out.
Requested by user who has reported this can be a problem.
Ensure that UTF-8 encoded strings can make it to, and from, Flickr correctly.
This module has been marked as "needs adoption" (by a new maintainer) on CPAN for some time now.
I'm not working with Perl much at all any more, and so this module's users would be better served by an active maintainer.
If you're interested, please comment on this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.