line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flickr::API2::Base; |
2
|
4
|
|
|
4
|
|
1525
|
use 5.12.0; |
|
4
|
|
|
|
|
9
|
|
3
|
4
|
|
|
4
|
|
15
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
72
|
|
4
|
4
|
|
|
4
|
|
15
|
use Moo; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
14
|
|
5
|
4
|
|
|
4
|
|
782
|
use Flickr::API2::Photo; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
787
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Flickr::API2::Base |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 DESCRIPTION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Base class for most of the API-helper classes. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 api |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
A reference to the parent API object. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'api' => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
isa => sub { die("Invalid API object") unless ($_[0]->isa('Flickr::API2')) }, |
26
|
|
|
|
|
|
|
required => 1, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 _response_to_photos |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Converts an API raw response (containing photo lists) into an array of |
34
|
|
|
|
|
|
|
our Photo objects. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _response_to_photos { |
39
|
3
|
|
|
3
|
|
9
|
my ($self, $photos) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my @photos = map { |
42
|
|
|
|
|
|
|
Flickr::API2::Photo->new( |
43
|
|
|
|
|
|
|
api => $self->api, |
44
|
|
|
|
|
|
|
id => $_->{id}, |
45
|
|
|
|
|
|
|
title => $_->{title}, |
46
|
|
|
|
|
|
|
date_upload => $_->{dateupload}, |
47
|
|
|
|
|
|
|
date_taken => $_->{datetaken}, |
48
|
|
|
|
|
|
|
owner_id => $_->{owner}, |
49
|
|
|
|
|
|
|
owner_name => $_->{ownername}, |
50
|
|
|
|
|
|
|
url_s => $_->{url_s}, |
51
|
|
|
|
|
|
|
height_s => $_->{height_s}, |
52
|
|
|
|
|
|
|
width_s => $_->{width_s}, |
53
|
|
|
|
|
|
|
url_m => $_->{url_m}, |
54
|
|
|
|
|
|
|
height_m => $_->{height_m}, |
55
|
|
|
|
|
|
|
width_m => $_->{width_m}, |
56
|
|
|
|
|
|
|
url_l => $_->{url_l}, |
57
|
|
|
|
|
|
|
height_l => $_->{height_l}, |
58
|
|
|
|
|
|
|
width_l => $_->{width_l}, |
59
|
|
|
|
|
|
|
url_o => $_->{url_o}, |
60
|
|
|
|
|
|
|
height_o => $_->{height_o}, |
61
|
|
|
|
|
|
|
width_o => $_->{width_o}, |
62
|
|
|
|
|
|
|
path_alias => $_->{pathalias}, |
63
|
|
|
|
|
|
|
count_faves => $_->{count_faves}, |
64
|
|
|
|
|
|
|
views => $_->{views}, |
65
|
16
|
|
|
|
|
945
|
), |
66
|
3
|
|
|
|
|
8
|
} @{ $photos->{photo} }; |
|
3
|
|
|
|
|
11
|
|
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
203
|
return @photos; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |