NAME
API::Instagram::Media - Instagram Media Object
VERSION
version 0.007
SYNOPSIS
my $media = $instagram->media(3);
printf "Caption: %s\n", $media->caption;
printf "Posted by %s (%d likes)\n\n", $media->user->username, $media->likes;
my $location = $media->location;
printf "Media Location: %s (%f,%f)", $location->name, $location->latitude, $location->longitude;
DESCRIPTION
See http://instagr.am/developer/endpoints/media/.
ATTRIBUTES
id
Returns media id.
type
Returns media type.
user
Returns the API::Instagram::User object of the user who posted the media.
link
Returns media shortlink.
filter
Returns media filter.
tags
Returns a list API::Instagram::Tag objects of media tags.
location
Returns media API::Instagram::Location object.
images
my $thumbnail = $media->images->{thumbnail};
printf "URL: %s (%d x %d)" $thumbnail->{url}, $thumbnail->{width}, $thumbnail->{height};
Returns media images options and details.
videos
my $standart = $media->videos->{standart_resolution};
printf "URL: %s (%d x %d)" $standart->{url}, $standart->{width}, $standart->{height};
Returns media videos options and details, when video type.
users_in_photo
for my $each ( @{ $media->users_in_photo } ) {
my $user = $each->{user};
my $position = $each->{position};
printf "%s is at %f, %f\n", $user->username, $position->{x}, $position->{y};
}
Returns a list of API::Instagram::User objects of users tagged in the media with their coordinates.
caption
Returns media caption text.
likes
Returns media total likes.
comments
Returns media total comments.
created_time
Returns the media date in a Time::Moment object.
METHODS
get_likes
my @likers = $media->get_likes( count => 5 );
Returns a list of API::Instagram::User objects of users who liked the media.
Accepts count
.
get_comments
my @comments = $media->get_comments( count => 5 );
Returns a list of API::Instagram::Media::Comment objects of the media.
Accepts count
.
AUTHOR
Gabriel Vieira <gabriel.vieira@gmail.com>
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.