| 1 | package Facebook::Graph::Publish::Comment; | ||||||||||
| 2 | 4 | $Facebook::Graph::Publish::Comment::VERSION = '1.1205'; | |||||||||
| 3 | 4 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | extends 'Facebook::Graph::Publish'; | |||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use constant object_path => '/comments'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 4 | has message => ( | |||||||||
| 9 | is => 'rw', | ||||||||||
| 10 | predicate => 'has_message', | ||||||||||
| 11 | ); | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub set_message { | ||||||||
|
Subroutine
set_message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 14 | 0 | my ($self, $message) = @_; | |||||||||
| 15 | 0 | $self->message($message); | |||||||||
| 16 | 0 | return $self; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | around get_post_params => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 22 | 0 | my ($orig, $self) = @_; | |||||||||
| 23 | 0 | my $post = $orig->($self); | |||||||||
| 24 | 0 | ▶ | if ($self->has_message) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | push @$post, message => $self->message; | |||||||||
| 26 | } | ||||||||||
| 27 | 0 | return $post; | |||||||||
| 28 | 4 | }; | |||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | 4 | 1; | |||||||||
| 32 | |||||||||||
| 33 | =head1 NAME | ||||||||||
| 34 | |||||||||||
| 35 | Facebook::Graph::Publish::Comment - Publish a comment on a post. | ||||||||||
| 36 | |||||||||||
| 37 | =head1 VERSION | ||||||||||
| 38 | |||||||||||
| 39 | version 1.1205 | ||||||||||
| 40 | |||||||||||
| 41 | =head1 SYNOPSIS | ||||||||||
| 42 | |||||||||||
| 43 | my $fb = Facebook::Graph->new; | ||||||||||
| 44 | |||||||||||
| 45 | $fb->add_comment($comment_id) | ||||||||||
| 46 | ->set_message('Why so serious?') | ||||||||||
| 47 | ->publish; | ||||||||||
| 48 | |||||||||||
| 49 | |||||||||||
| 50 | =head1 DESCRIPTION | ||||||||||
| 51 | |||||||||||
| 52 | This module gives you quick and easy access to publish comments on posts. | ||||||||||
| 53 | |||||||||||
| 54 | B<ATTENTION:> You must have the C<publish_stream> privilege to use this module. | ||||||||||
| 55 | |||||||||||
| 56 | =head1 METHODS | ||||||||||
| 57 | |||||||||||
| 58 | =head2 set_message ( message ) | ||||||||||
| 59 | |||||||||||
| 60 | Sets the text to post to the wall. | ||||||||||
| 61 | |||||||||||
| 62 | =head3 message | ||||||||||
| 63 | |||||||||||
| 64 | A string of text. | ||||||||||
| 65 | |||||||||||
| 66 | |||||||||||
| 67 | |||||||||||
| 68 | =head2 publish ( ) | ||||||||||
| 69 | |||||||||||
| 70 | Posts the data and returns a L<Facebook::Graph::Response> object. The response object should contain the id: | ||||||||||
| 71 | |||||||||||
| 72 | {"id":"1647395831_130068550371568"} | ||||||||||
| 73 | |||||||||||
| 74 | =head1 LEGAL | ||||||||||
| 75 | |||||||||||
| 76 | Facebook::Graph is Copyright 2010 - 2017 Plain Black Corporation (L<http://www.plainblack.com>) and is licensed under the same terms as Perl itself. | ||||||||||
| 77 | |||||||||||
| 78 | =cut | ||||||||||