File Coverage

blib/lib/Flickr/API2/Interestingness.pm
Criterion Covered Total %
statement 12 12 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 3 3 100.0
pod 1 1 100.0
total 18 21 85.7


line stmt bran cond sub pod time code
1             package Flickr::API2::Interestingness;
2 4     4   19 use Mouse;
  4         9  
  4         23  
3 4     4   1181 use Flickr::API2::Photo;
  4         7  
  4         601  
4             extends 'Flickr::API2::Base';
5              
6             =head1 NAME
7              
8             Flickr::API2::Interestingness
9              
10             =head1 SYNOPSIS
11              
12             See getList() below.
13              
14             =head1 METHODS
15              
16             =head2 getList
17              
18             Returns the list of interesting photos for the most recent day or a
19             user-specified date.
20              
21             See http://www.flickr.com/services/api/flickr.interestingness.getList.html
22             for available options.
23              
24             =cut
25              
26             # Note - this is basically a carbon-copy of the photos.search method :/
27             sub getList {
28 1     1 1 93 my $self = shift;
29 1         5 my %args = @_;
30              
31 1   33     14 $args{extras} ||= join(',',
32             qw(
33             date_upload date_taken owner_name url_s url_m url_l path_alias
34             )
35             );
36              
37 1         13 my $r = $self->api->execute_method(
38             'flickr.interestingness.getList', \%args
39             );
40 1 50       6 die("Didn't understand response (or no photos)")
41             unless exists $r->{photos};
42            
43 1         17 return $self->_response_to_photos($r->{photos})
44             }
45              
46             __PACKAGE__->meta->make_immutable;
47             1;