API-Instagram

 view release on metacpan or  search on metacpan

CHANGES  view on Meta::CPAN

==================================================
Changes from 2013-08-28 00:00:00 +0000 to present.
==================================================

------------------------------------------
version 0.013 at 2014-08-28 03:57:09 +0000
------------------------------------------

  Change: c9e9ae4852ac563c904f3a1a22d750ef47373db6
  Author: Gabriel Vieira <gabriel.vieira@gmail.com>
  Date : 2014-08-28 00:52:40 +0000

CHANGES  view on Meta::CPAN

  Date : 2014-08-17 01:37:20 +0000

    Removed use API::Instagram::Direct request 

  Change: 905fe6e5d9a8c1a161372a85a297e785f11113b0
  Author: Gabriel Vieira <gabriel.vieira@gmail.com>
  Date : 2014-08-17 01:28:00 +0000

    Media Tags attribute is lazy now - only when requested the tags
    objects are generated. Fixed Data request when generating an object.
    It was doing resquests even when not needed. Starting version 0.006. 

  Change: fddb24512b62762eabbc4bd6d7998a94de7d7aaa
  Author: Gabriel Vieira <gabriel.vieira@gmail.com>
  Date : 2014-08-16 09:31:23 +0000

    Starting version 0.005.1 - DOC fixing thanks to Tudor Marghidanu
    (marghidanu) 

  Change: 5cd898120384c77242c6942d3f07d84391322e33
  Author: Gabriel Vieira <gabriel.vieira@gmail.com>

INSTALL  view on Meta::CPAN

    % cpanm -S API::Instagram

## Installing with the CPAN shell

Alternatively, if your CPAN shell is set up, you should just be able to do:

    % cpan API::Instagram

## Manual installation

As a last resort, you can manually install it. Download the tarball, untar it,
then build it:

    % perl Makefile.PL
    % make && make test

Then install it:

    % make install

If you are installing into a system-wide directory, you may need to run:

LICENSE  view on Meta::CPAN

software and to any other program whose authors commit to using it.
You can use it for your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must tell them their rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

LICENSE  view on Meta::CPAN


                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License.  The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications.  Each
licensee is addressed as "you".

  1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program.  You may charge a fee for the physical act of
transferring a copy.

LICENSE  view on Meta::CPAN

    exchange for a fee.

Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.

  3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:

    a) accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    b) accompany it with a written offer, valid for at least three
    years, to give any third party free (except for a nominal charge
    for the cost of distribution) a complete machine-readable copy of the
    corresponding source code, to be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    c) accompany it with the information you received as to where the
    corresponding source code may be obtained.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form alone.)

Source code for a work means the preferred form of the work for making
modifications to it.  For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.

  4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License.  However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.

  5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions.  You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.

  7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.

  8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

                            NO WARRANTY

  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS

LICENSE  view on Meta::CPAN

The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  program `Gnomovision' (a program to direct compilers to make passes
  at assemblers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

That's all there is to it!


--- The Artistic License 1.0 ---

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

This is free software, licensed under:

LICENSE  view on Meta::CPAN

  - "Reasonable copying fee" is whatever you can justify on the basis of media
    cost, duplication charges, time of people involved, and so on. (You will
    not be required to justify it to the Copyright Holder, but only to the
    computing community at large as a market that must bear the fee.) 
  - "Freely Available" means that no fee is charged for the item itself, though
    there may be fees involved in handling the item. It also means that
    recipients of the item may redistribute it under the same conditions they
    received it. 

1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.

2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.

3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

LICENSE  view on Meta::CPAN

4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:

  a) distribute a Standard Version of the executables and library files,
     together with instructions (in the manual page or equivalent) on where to
     get the Standard Version.

  b) accompany the distribution with the machine-readable source of the Package
     with your modifications.

  c) accompany any non-standard executables with their corresponding Standard
     Version executables, giving the non-standard executables non-standard
     names, and clearly documenting the differences in manual pages (or
     equivalent), together with instructions on where to get the Standard
     Version.

  d) make other distribution arrangements with the Copyright Holder.

5. You may charge a reasonable copying fee for any distribution of this
Package.  You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this

META.yml  view on Meta::CPAN

---
abstract: 'Object Oriented Interface for the Instagram REST and Search APIs'
author:
  - 'Gabriel Vieira <gabriel.vieira@gmail.com>'
build_requires:
  File::Spec: 0
  Furl::Response: 0
  IO::Handle: 0
  IPC::Open3: 0
  Inline::Files: 0
  Test::MockObject::Extends: 0
  Test::More: 0
  perl: 5.010
configure_requires:
  ExtUtils::MakeMaker: 0
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142060'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: API-Instagram
requires:
  Carp: 0
  Data::Dumper: 0
  Digest::MD5: 0
  Furl: 0
  JSON: 0
  Moo: 0
  Time::Moment: 0
  URI: 0
  experimental: 0
  perl: 5.010
  strict: 0
  warnings: 0
resources:
  bugtracker: https://github.com/gabrielmad/api-instagram/issues
  homepage: http://metacpan.org/release/API-Instagram
  repository: git://github.com/gabrielmad/api-instagram.git
version: 0.013

README  view on Meta::CPAN

   Authorize
    Get the AUTH URL to authenticate.

            use API::Instagram;

            my $instagram = API::Instagram->new({
                            client_id     => 'xxxxxxxxxx',
                            client_secret => 'xxxxxxxxxx',
                            redirect_uri  => 'http://localhost',
                            scope         => 'basic',
                            response_type => 'code',
                            granty_type   => 'authorization_code',
            });

            print $instagram->get_auth_url;

   Authenticate
    After authorization, Instagram will redirected the user to the URL in
    "redirect_uri" with a code as an URL query parameter. This code is
    needed to obtain an acess token.

README  view on Meta::CPAN

            my $me = $instagram->user;
            print $me->full_name;

METHODS
  new
            my $instagram = API::Instagram->new({
                            client_id     => $client_id,
                            client_secret => $client_secret,
                            redirect_uri  => 'http://localhost',
                            scope         => 'basic',
                            response_type => 'code',
                            granty_type   => 'authorization_code',
                            no_cache      => 1,
            });

    Returns an API::Instagram object.

    Set "client_id", "client_secret" and "redirect_uri" with the ones
    registered to your application. See
    <http://instagram.com/developer/clients/manage/>.

    "scope" is the scope of access. See
    <http://instagram.com/developer/authentication/#scope>.

    "response_type" and "granty_type" do no vary. See
    <http://instagram.com/developer/authentication/>.

    By default, API::Instagram caches created objects to avoid duplications.
    You can disable this feature setting a true value to "no_chace"
    parameter.

  instance
            my $instagram = API::Instagram->instance;
            print $instagram->user->full_name;

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

use API::Instagram::Location;
use API::Instagram::Tag;
use API::Instagram::Media;
use API::Instagram::Media::Comment;
use API::Instagram::Search;

has client_id         => ( is => 'ro', required => 1 );
has client_secret     => ( is => 'ro', required => 1 );
has redirect_uri      => ( is => 'ro', required => 1 );
has scope             => ( is => 'ro', default => sub { 'basic' } );
has response_type     => ( is => 'ro', default => sub { 'code'  } );
has grant_type        => ( is => 'ro', default => sub { 'authorization_code' } );
has code              => ( is => 'rw', isa => sub { confess "Code not provided"        unless $_[0] } );
has access_token      => ( is => 'rw', isa => sub { confess "No access token provided" unless $_[0] } );
has no_cache          => ( is => 'rw', default => sub { 0 } );

has _ua               => ( is => 'ro', default => sub { Furl->new() } );
has _obj_cache        => ( is => 'ro', default => sub { { User => {}, Media => {}, Location => {}, Tag => {}, 'Media::Comment' => {} } } );
has _endpoint_url     => ( is => 'ro', default => sub { 'https://api.instagram.com/v1'                 } );
has _authorize_url    => ( is => 'ro', default => sub { 'https://api.instagram.com/oauth/authorize'    } );
has _access_token_url => ( is => 'ro', default => sub { 'https://api.instagram.com/oauth/access_token' } );

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

my $instance;
sub BUILD { $instance = shift }

sub instance { $instance //= shift->new(@_) }

sub get_auth_url { 
	my $self = shift;

	carp "User already authorized with code: " . $self->code if $self->code;

	my @auth_fields = qw(client_id redirect_uri response_type scope);
	for ( @auth_fields ) {
		carp "ERROR: $_ required for generating authorization URL" and return unless defined $self->$_;
	}

	my $uri = URI->new( $self->_authorize_url );
	$uri->query_form( map { $_ => $self->$_ } @auth_fields );
	$uri->as_string();
}


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

	my ( $self, $method, $url, $params, $opts ) = @_;

	# Verifies access requirements
	unless ( defined $self->access_token ) {
		if ( !$opts->{token_not_required} or !defined $self->client_id ) {
			carp "A valid access_token is required";
			return {}
		}
	}

	# If URL is not prepared, prepares it
	unless ( $opts->{prepared_url} ){

		$url =~ s|^/||;
		$params->{access_token} = $self->access_token;

		# Prepares the URL
		my $uri = URI->new( $self->_endpoint_url );
		$uri->path_segments( $uri->path_segments, split '/', $url );
		$uri->query_form($params);
		$url = $uri->as_string;
	}

	# For debugging purposes
	print "Requesting: $url$/" if $self->_debug;

	# Treats response content
	my $res = decode_json $self->_ua->$method( $url, [], $params )->decoded_content;

	# Verifies meta node
	my $meta = $res->{meta};
	carp "$meta->{error_type}: $meta->{error_message}" if $meta->{code} ne '200';

use Data::Dumper;
# die Dumper $res;
	$res;
}

sub _request_data { shift->_request(@_)->{data} || {} }

sub _del  { shift->_request_data( 'delete', @_ ) }
sub _get  { shift->_request_data( 'get',    @_ ) }
sub _post { shift->_request_data( 'post',   @_ ) }

################################
# Returns requested cache hash #

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

__END__

=pod

=encoding UTF-8

=head1 NAME

API::Instagram - Object Oriented Interface for the Instagram REST and Search APIs

=for Pod::Coverage client_id client_secret grant_type no_cache redirect_uri response_type scope BUILD

=for HTML <a href="https://travis-ci.org/gabrielmad/API-Instagram"><img src="https://travis-ci.org/gabrielmad/API-Instagram.svg?branch=build%2Fmaster"></a>

=for HTML <a href='https://coveralls.io/r/gabrielmad/API-Instagram?branch=build%2Fmaster'><img src='https://coveralls.io/repos/gabrielmad/API-Instagram/badge.png?branch=build%2Fmaster' alt='Coverage Status' /></a>

=head1 VERSION

version 0.013

=head1 SYNOPSIS

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


Get the AUTH URL to authenticate.

	use API::Instagram;

	my $instagram = API::Instagram->new({
			client_id     => 'xxxxxxxxxx',
			client_secret => 'xxxxxxxxxx',
			redirect_uri  => 'http://localhost',
			scope         => 'basic',
			response_type => 'code',
			granty_type   => 'authorization_code',
	});

	print $instagram->get_auth_url;

=head3 Authenticate

After authorization, Instagram will redirected the user to the URL in
C<redirect_uri> with a code as an URL query parameter. This code is needed
to obtain an acess token.

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


=head1 METHODS

=head2 new

	my $instagram = API::Instagram->new({
			client_id     => $client_id,
			client_secret => $client_secret,
			redirect_uri  => 'http://localhost',
			scope         => 'basic',
			response_type => 'code',
			granty_type   => 'authorization_code',
			no_cache      => 1,
	});

Returns an L<API::Instagram> object.

Set C<client_id>, C<client_secret> and C<redirect_uri> with the ones registered
to your application. See L<http://instagram.com/developer/clients/manage/>.

C<scope> is the scope of access. See L<http://instagram.com/developer/authentication/#scope>.

C<response_type> and C<granty_type> do no vary. See L<http://instagram.com/developer/authentication/>.

By default, L<API::Instagram> caches created objects to avoid duplications. You can disable
this feature setting a true value to C<no_chace> parameter.

=head2 instance

	my $instagram = API::Instagram->instance;
	print $instagram->user->full_name;

	or

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


=head2 images

	my $thumbnail = $media->images->{thumbnail};
	printf "URL: %s (%d x %d)" $thumbnail->{url}, $thumbnail->{width}, $thumbnail->{height};

Returns media images options and details.

=head2 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.

=head2 users_in_photo

	for my $each ( @{ $media->users_in_photo } ) {

		my $user     = $each->{user};
		my $position = $each->{position};

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

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

t/00-instagram.t  view on Meta::CPAN

use JSON;
use Furl;
use Furl::Response;
use Inline::Files;

use API::Instagram;
use Test::More tests => 17;

my $data = join '', <DATA>;
my $ua   = Test::MockObject::Extends->new( Furl->new() );
my $res  = Test::MockObject::Extends->new( Furl::Response->new( 1, 200, 'OK', {}, $data) );

$ua->mock('get',  sub { $res });
$ua->mock('post', sub { $res });

my $api = API::Instagram->new({
			client_id     => '123',
			client_secret => '456',
			redirect_uri  => 'http://localhost',
            no_cache      => 1,
            _ua           => $ua,
});


t/00-instagram.t  view on Meta::CPAN

isa_ok( $me, 'API::Instagram::User');
is $me->username, "snoopdogg";

is ref $api->_request('get','media'), 'HASH';

my @list = $api->_get_list( { url => 'media', count => 2 } );
is ~~@list , 2;

# Tests Popular Medias method with new DATA (__POPULAR__)
my $popular = join '', <POPULAR>;
my $res2 = Test::MockObject::Extends->new( Furl::Response->new( 1, 200, 'OK', {}, $popular) );
$ua->mock('get',  sub { $res2 });

is ref $api2->popular_medias, 'ARRAY';
is $api2->popular_medias->[0]->user->username, 'cocomiin';

__DATA__
{
    "meta": {
        "code": 200
    },
    "pagination": {

t/00-instagram.t  view on Meta::CPAN

            },
            "link": "http://instagr.am/p/BV5v_/",
            "user": {
                "username": "cocomiin",
                "full_name": "Cocomiin",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1127272_75sq_1296145633.jpg",
                "id": "1127272"
            },
            "created_time": "1296655883",
            "images": {
                "low_resolution": {
                    "url": "http://distillery.s3.amazonaws.com/media/2011/02/01/34d027f155204a1f98dde38649a752ad_6.jpg",
                    "width": 306,
                    "height": 306
                },
                "thumbnail": {
                    "url": "http://distillery.s3.amazonaws.com/media/2011/02/01/34d027f155204a1f98dde38649a752ad_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution": {
                    "url": "http://distillery.s3.amazonaws.com/media/2011/02/01/34d027f155204a1f98dde38649a752ad_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "id": "22518783",
            "location": null
        }, {
            "type": "video",
            "videos": {
                "low_resolution": {
                    "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
                    "width": 480,
                    "height": 480
                },
                "standard_resolution": {
                    "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
                    "width": 640,
                    "height": 640
                },
                "users_in_photo": null,
                "filter": "Vesper",
                "tags": [],
                "comments": {
                    "data": [{
                        "created_time": "1279332030",

t/00-instagram.t  view on Meta::CPAN

                "user": {
                    "username": "kevin",
                    "full_name": "Kevin S",
                    "profile_picture": "...",
                    "bio": "...",
                    "website": "...",
                    "id": "3"
                },
                "created_time": "1279340983",
                "images": {
                    "low_resolution": {
                        "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
                        "width": 306,
                        "height": 306
                    },
                    "thumbnail": {
                        "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
                        "width": 150,
                        "height": 150
                    },
                    "standard_resolution": {
                        "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
                        "width": 612,
                        "height": 612
                    }
                },
                "id": "3",
                "location": null
            }
        }
    ]

t/00-media.t  view on Meta::CPAN


is ref $media->last_likes(1), 'ARRAY';
is ref $media->last_comments(1), 'ARRAY';


__DATA__
{
    "data": {
        "type": "video",
        "videos": {
            "low_resolution": {
                "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
                "width": 480,
                "height": 480
            },
            "standard_resolution": {
                "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
                "width": 640,
                "height": 640
            }
        },
        "users_in_photo": null,
        "filter": "Vesper",
        "tags": ["test"],
        "comments": {
            "data": [{

t/00-media.t  view on Meta::CPAN

        "user": {
            "username": "kevin",
            "full_name": "Kevin S",
            "profile_picture": "...",
            "bio": "...",
            "website": "...",
            "id": "3"
        },
        "created_time": "1279340983",
        "images": {
            "low_resolution": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
                "width": 306,
                "height": 306
            },
            "thumbnail": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
                "width": 612,
                "height": 612
            }
        },
        "id": "3",
        "location": { "latitude":"0.2",
        "longitude":"0.3"}
    }
}

t/01-media.t  view on Meta::CPAN

is ref $media->like,    'HASH';
is ref $media->dislike, 'HASH';

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

__DATA__
{
    "data": {
        "type": "video",
        "videos": {
            "low_resolution": {
                "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
                "width": 480,
                "height": 480
            },
            "standard_resolution": {
                "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
                "width": 640,
                "height": 640
            }
        },
        "users_in_photo": [
            {
                "user": {
                    "username": "kevin",
                    "full_name": "Kevin S",

t/01-media.t  view on Meta::CPAN

        "user": {
            "username": "kevin",
            "full_name": "Kevin S",
            "profile_picture": "...",
            "bio": "...",
            "website": "...",
            "id": "3"
        },
        "created_time": "1279340983",
        "images": {
            "low_resolution": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
                "width": 306,
                "height": 306
            },
            "thumbnail": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution": {
                "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
                "width": 612,
                "height": 612
            }
        },
        "id": "3",
        "location": null
    }
}



( run in 1.269 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )