Giter Club home page Giter Club logo

instagram-basic-display-api-simple-integration's Introduction

Instagram Basic Display API Simple Integration

A simple PHP implementation of the Instagram Basic Display API

This implementation does the following:

  1. index.php provides a link to authorize the implementation
  2. If authorizes, we'll be taken back to /callback.php with an attached Oauth code
  3. We then exchange the code, with a short-lived access token, then in the same step, we exchange that short-lived access token with a long-lived access token
  4. Once we have our access tokens, we write a fake "user" to a very fake "database"
  5. We redirect to view.php, where we look for new posts then display them

File Structure

File Description
callback.php Part of Step 2, this function receieves the authorization code and starts the process of getting a long-lived token we can use to fetch the fun stuff
config.php This is where your APP ID, APP Secret, and Callback URLS are defined. See config.php.sample for example
config.php.sample ^
fake_database.txt We're literally just writing JSON to a file. Like I said, it's a very simple integration
http.php Utility class to handle curl GET and POST requests. I re-use this class a lot
index.php Part of Step 1, this page provides the authorization URL to get started
settings-functions.php This is the beef of the program. Defines our API endpoints, make sure our configuration is intact, makes all API calls, and adds a few helper functions
view.php Part of Step 5, this would be like the "logged in" view and shows the retrieved users posts

Screenshots

Config

Set up config.php with variables from API setup

alt text

The final result

alt text

instagram-basic-display-api-simple-integration's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.