API-Instagram

 view release on metacpan or  search on metacpan

lib/API/Instagram/Media.pm  view on Meta::CPAN

Accepts C<count>.

=head2 like

	$media->like;

Sets a like on the media by the authenticated user.

=head2 dislike

	$media->dislike;

Removes a like on the media by the authenticated user.

=head2 comments

	printf "Total Comments: %d\n", $media->comments; # Total comments when object was created

	or

	printf "Total Comments: %d\n", $media->comments(1); # Up to date total comments

Returns media total comments.
If you set C<1> as parameter it will renew all media data and return an up-do-date total comments.

Note: C<1> as parameter also updates total likes, last likes and last comments.

=head2 last_comments

	for my $comment ( @{ $media->last_comments } ) {
		printf "%s: %s\n", $comment->from->username, $comment->text;
	}

Returns a list of C<API::Instagram::Media::Comment> of the last comments on the media.
If you set C<1> as parameter it will renew all media data and return an up-do-date list.

Note: C<1> as parameter also updates total likes, total comments and last likes.

=head2 get_comments

	my @comments = $media->get_comments( count => 5 );

Returns a list of L<API::Instagram::Media::Comment> objects of the media.

Accepts C<count>.

=head2 comment

	$media->comment("Nice pic!");

Creates a comment on the media.

Note: This endpoint is restrict, check  L<https://help.instagram.com/contact/185819881608116> for more information.

=head1 AUTHOR

Gabriel Vieira <gabriel.vieira@gmail.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Gabriel Vieira.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut



( run in 0.377 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )