Flickr-API2 icon indicating copy to clipboard operation
Flickr-API2 copied to clipboard

Getting total photos

Open dbough opened this issue 12 years ago • 0 comments

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.

dbough avatar Apr 26 '13 01:04 dbough