API-Instagram
view release on metacpan or search on metacpan
or
my ( $access_token, $auth_user ) = $instagram->get_access_token;
Returns the access token string if the context is looking for a scalar,
or an array containing the access token string and the authenticated
user API::Instagram::User object if looking for a list value.
media
my $media = $instagram->media( $media_id );
say $media->type;
Get information about a media object. Returns an API::Instagram::Media
object.
user
my $me = $instagram->user; # Authenticated user
say $me->username;
my $user = $instagram->user( $user_id );
say $user->full_name;
Get information about an user. Returns an API::Instagram::User object.
location
my $location = $instagram->location( $location_id );
say $location->name;
Get information about a location. Returns an API::Instagram::Location
object.
tag
my $tag = $instagram->tag('perl');
say $tag->media_count;
Get information about a tag. Returns an API::Instagram::Tag object.
search
my $search = $instagram->search('user');
my $users = $search->find( q => 'larry' );
for my $user ( @$users ) {
say $user->username;
}
Returns an API::Instagram::Search object, capable to search for the
given type.
Where type can be: "user", "media", "tag" or "location".
See API::Instagram::Search for more details and examples.
popular_medias
lib/API/Instagram.pm view on Meta::CPAN
my ( $access_token, $auth_user ) = $instagram->get_access_token;
Returns the access token string if the context is looking for a scalar, or an
array containing the access token string and the authenticated user
L<API::Instagram::User> object if looking for a list value.
=head2 media
my $media = $instagram->media( $media_id );
say $media->type;
Get information about a media object. Returns an L<API::Instagram::Media> object.
=head2 user
my $me = $instagram->user; # Authenticated user
say $me->username;
my $user = $instagram->user( $user_id );
say $user->full_name;
Get information about an user. Returns an L<API::Instagram::User> object.
=head2 location
my $location = $instagram->location( $location_id );
say $location->name;
Get information about a location. Returns an L<API::Instagram::Location> object.
=head2 tag
my $tag = $instagram->tag('perl');
say $tag->media_count;
Get information about a tag. Returns an L<API::Instagram::Tag> object.
=head2 search
my $search = $instagram->search('user');
my $users = $search->find( q => 'larry' );
for my $user ( @$users ) {
say $user->username;
}
Returns an L<API::Instagram::Search> object, capable to search for the given B<type>.
Where B<type> can be: C<user>, C<media>, C<tag> or C<location>.
See L<API::Instagram::Search> for more details and examples.
=head2 popular_medias
lib/API/Instagram/Media.pm view on Meta::CPAN
printf "Total Likes: %d\n", $media->likes(1); # Up to date total likes
Returns media total likes.
If you set C<1> as parameter it will renew all media data and return an up-do-date total likes.
Note: C<1> as parameter also updates total comments, last likes and last comments.
=head2 last_likes
for my $user ( @{ $media->last_likes } ) {
say $user->username;
}
Returns a list of C<API::Instagram::User> of the last users who liked 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 comments.
=head2 get_likes
my @likers = $media->get_likes( count => 5 );
lib/API/Instagram/Search.pm view on Meta::CPAN
version 0.013
=head1 METHODS
=head2 find
my $users = $instagram->search('user')->find( q => 'larry' );
for my $user ( @$users ) {
say $user->username;
}
Returns a list of B<type> objects searched with the given parameters.
Where B<type> can be: C<user>, C<media>, C<tag> or C<location>.
B<user> parameters:
my $search = $instagram->search('user');
$search->find(
lib/API/Instagram/User.pm view on Meta::CPAN
my $medias = $user->recent_medias( count => 5 );
print $_->caption . $/ for @$medias;
Returns a list of L<API::Instagram::Media> objects of user's recent medias.
Accepts C<count>, C<min_timestamp>, C<min_id>, C<max_id> and C<max_timestamp> as parameters.
=head2 relationship
my $relationship = $user->relationship;
say $relationship->{incoming_status};
Returns a C<HASH> reference contaning information about the relationship of the user with the authenticated user.
This reference contains two keys:
B<outgoing_status:> Authenticated user relationship to the user. Can be C<follows>, C<requested>, C<none>.
B<incoming_status:> A user's relationship to the authenticated user. Can be C<followed_by>, C<requested_by>, C<blocked_by_you>, C<none>.
$user->relationship('follow');
( run in 1.109 second using v1.01-cache-2.11-cpan-5b529ec07f3 )