WebService::Instagram - Simple Interface to Instagram oAuth API
Version 0.05
Get the AUTH URL to authenticate,
use WebService::Instagram; my $instagram = WebService::Instagram->new( { client_id => 'xxxxxxxxxxxxxxx', client_secret => 'xxxxxxxxxxxxxxx', redirect_uri => 'http://domain.com', } ); my $auth_url = $instagram->get_auth_url(); print Dumper $auth_url;
Go to the above calculated URL in the browser, authenticate and save the code returned by the browser after authentication. You will need this to get access_token in Step 3.
The returned URL is usually of the form www.returnuri.com/?code=xxxxxxxxxxx
Now using the code, fetch the access_token and set it to the object,
$instagram->set_code( $code ); #$code is fetched from Step 2. my $access_token = $instagram->get_access_token(); #Set the access_token to $instagram object $instagram->set_access_token( $access_token );
Fetch the protected resource.
#Get information about the owner of the access_token. my $search_result = $instagram->request( 'https://api.instagram.com/v1/users/self' );
Returns the authorization URL that the user has to authorize against. Once authorized, the browser appends the code along to the redirect URL which will used for obtaining access_token later.
code
Once you have the code, you are ready to get the access_token.
Since you now have the access token, you can request all the resources on behalf of the API.
Daya Sagar Nune, <dayanune at cpan.org>
<dayanune at cpan.org>
This module's source and other documentation is hosted at: https://github.com/odem5442/WebService-Instagram
Copyright 2013 Daya Sagar Nune.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install WebService::Instagram, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Instagram
CPAN shell
perl -MCPAN -e shell install WebService::Instagram
For more information on module installation, please visit the detailed CPAN module installation guide.