guzzlehttp/guzzle-instagram-subscriber

v0.2.0 2016-03-17 14:50 UTC

This package is not auto-updated.

Last update: 2024-11-12 14:34:16 UTC


README

Latest Stable Version Build Status

guzzle-instagram-subscriber

Guzzle Subscriber Instagram: Authorizes the instagram app and generates the access token using login / password

Installing

This project can be installed using Composer. Add the following to your composer.json:

    {
        "require": {
            "guzzlehttp/guzzle-instagram-subscriber": "dev-master"
        }
    }

Retrieve the access token using the Implicit Authorization Subscriber

Here's an example showing how to authorize an instagram app and generate access token just one step:

    use GuzzleHttp\Client;
    use GuzzleHttp\Subscriber\Instagram\ImplicitAuth;

    $client = new Client();

    $config = [
        'username' => 'instagram_username',
        'password' => 'instagram_password',
        'client_id'    => 'instagram_client_id',
        'redirect_uri' => 'instagram_redirect_uri',
    ];

    $implicitAuth = new ImplicitAuth($config);
    $client->getEmitter()->attach($implicitAuth);

    $client->post('https://instagram.com/oauth/authorize');

    $access_token = $implicitAuth->getAccessToken();

Once you've registered your client it's easy to start requesting data from Instagram, Using this access token to request the Instagram API endpoints. More information: http://instagram.com/developer/endpoints/