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