line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Facebook::Graph::Publish; |
2
|
|
|
|
|
|
|
$Facebook::Graph::Publish::VERSION = '1.1202'; |
3
|
4
|
|
|
4
|
|
1670
|
use Moo; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
19
|
|
4
|
4
|
|
|
4
|
|
789
|
use Facebook::Graph::Request; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
91
|
|
5
|
|
|
|
|
|
|
with 'Facebook::Graph::Role::Uri'; |
6
|
4
|
|
|
4
|
|
12
|
use LWP::UserAgent; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
67
|
|
7
|
4
|
|
|
4
|
|
13
|
use URI::Escape; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
877
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has secret => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
required => 0, |
12
|
|
|
|
|
|
|
predicate => 'has_secret', |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has access_token => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
predicate => 'has_access_token', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has object_name => ( |
21
|
|
|
|
|
|
|
is => 'rw', |
22
|
|
|
|
|
|
|
default => 'me', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub to { |
26
|
0
|
|
|
0
|
0
|
|
my ($self, $object_name) = @_; |
27
|
0
|
|
|
|
|
|
$self->object_name($object_name); |
28
|
0
|
|
|
|
|
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_post_params { |
32
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
my @post; |
34
|
0
|
0
|
|
|
|
|
if ($self->has_access_token) { |
35
|
0
|
|
|
|
|
|
push @post, access_token => uri_unescape($self->access_token); |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
return \@post; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub publish { |
41
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
42
|
0
|
|
|
|
|
|
my $uri = $self->uri; |
43
|
0
|
|
|
|
|
|
$uri->path($self->generate_versioned_path($self->object_name.$self->object_path)); |
44
|
0
|
|
|
|
|
|
return Facebook::Graph::Request->new->post($uri, $self->get_post_params); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Facebook::Graph::Publish - A base class for publishing various things to facebook. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 1.1202 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This module shouldn't be used by you directly for any purpose. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 LEGAL |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Facebook::Graph is Copyright 2010 - 2012 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |