line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Facebook::Graph::Request; |
2
|
|
|
|
|
|
|
$Facebook::Graph::Request::VERSION = '1.1204'; |
3
|
4
|
|
|
4
|
|
28
|
use Moo; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
26
|
|
4
|
4
|
|
|
4
|
|
1316
|
use JSON; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
36
|
|
5
|
4
|
|
|
4
|
|
592
|
use Ouch; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
337
|
|
6
|
4
|
|
|
4
|
|
2248
|
use LWP::UserAgent; |
|
4
|
|
|
|
|
108705
|
|
|
4
|
|
|
|
|
141
|
|
7
|
4
|
|
|
4
|
|
1833
|
use LWP::Protocol::https; |
|
4
|
|
|
|
|
283767
|
|
|
4
|
|
|
|
|
207
|
|
8
|
4
|
|
|
4
|
|
1471
|
use Facebook::Graph::Response; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
681
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has ua => ( |
11
|
|
|
|
|
|
|
is => 'rw', |
12
|
|
|
|
|
|
|
isa => sub {ouch(442,"$_[0] is not an LWP::UserAgent object") unless ref $_[0] eq 'LWP::UserAgent'}, |
13
|
|
|
|
|
|
|
lazy => 1, |
14
|
|
|
|
|
|
|
default => sub { |
15
|
|
|
|
|
|
|
my $ua = LWP::UserAgent->new; |
16
|
|
|
|
|
|
|
$ua->timeout(30); |
17
|
|
|
|
|
|
|
return $ua; |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub post { |
22
|
0
|
|
|
0
|
1
|
|
my ($self, $uri, @params) = @_; |
23
|
0
|
|
|
|
|
|
return Facebook::Graph::Response->new(response => $self->ua->post($uri, @params)); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub get { |
27
|
0
|
|
|
0
|
1
|
|
my ($self, $uri) = @_; |
28
|
0
|
|
|
|
|
|
return Facebook::Graph::Response->new(response => $self->ua->get($uri)); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Facebook::Graph::Request - Handling posts to Facebook Graph. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 1.1204 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This is the standard interface to the Facebook Graph API that all other modules use. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHODS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 new(params) |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=over |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item params |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
A hash or hashref of parameters to pass to the constructor. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item ua |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
An L<LWP::UserAgent> object. It will be created for you if you don't pass one in. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=back |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=back |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 post ( uri, params ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
A POST request will be made. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=over |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item uri |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
A URI string to Facebook. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item headers |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
A hash of headers to pass to L<LWP::UserAgent> when making the request. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=back |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 get ( uri, params ) |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
A GET request will be made. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=over |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item uri |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
A URI to fetch. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 LEGAL |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |