Git Product home page Git Product logo

instagram-oauth-php's Introduction

instagram-oauth-php

A simple PHP library I made to make my life easier when working with Instagram's REST API.

In a nutshell, this library will take care of getting OAuth authorization and obtaining an access token to send to the API.

It's then up to the user to utilize the convenience wrapper methods to POST, GET, PUT, and DELETE things to the correct API endpoints with the correct parameters. I didn't hard-code any API endpoints or parameters bar the ones needed for OAuth.

Features

  • Handles authorization and access token request upon instantiation
  • Saves initial user data returned by Instagram upon access token request
  • Provides convenience wrappers for POST, GET, PUT, and DELETE
  • Provides convenience method for retrieving images

Usage

A few of things you'll need to do before using this library:

  1. Set up an Instagram client (http://instagram.com/developer/clients/manage/)
  2. Note down your client ID, secret and redirect URI (or leave a tab open with the details open)
  3. Decide what extra permissions you'll need (if any - permission constants are available from the class)

Once you have everything prepared, all you need is to pass all those into the constructor and wait for a response before running any queries, like so:

require "path/to/instagramoauth.class.php";

$instagram = new InstagramOAuth(
	"[YOUR CLIENT ID]",
	"[YOUR CLIENT SECRET]",
	"[YOUR REDIRECT URI]",
	array("[YOUR PERMISSIONS]")
);

if ($instagram->isReady()) {
	// Yay, now we can start API-ing
}

Take a look at the source and example files to get a better understanding of how to use it properly.

Bugs and feature requests

I made this library to use on my own projects so I make no guarantees that it can cater for all your needs. So far it's been able to do everything I need it to. YMMV.

With that said, if you've found a bug or have a feature request please open a new issue.

I made this library in part as a learning experience, so please feel free to fork or pull or whatever if you would like to build on or improve it.

Copyright and license

Copyright 2013 Bagus Tri K under the MIT license.

instagram-oauth-php's People

Contributors

irot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.