Coder Social home page Coder Social logo

deno-insta-feed's Introduction

Instagram User Media Feed

Instagram User Media Feed API using Deno TypeScript Runtime.

Application has Web Server and Import executables.

Usage - Web Server

Setup .env file.

Http:port = 8000

Instagram:appId = 'INSTAGRAM_API'
Instagram:appSecret = 'INSTAGRAM_SECRET'
Instagram:redirectUri = "INSTAGRAM_REDIRECT_URI"

Mysql:hostname = 'MYSQL_HOSTNAME'
Mysql:username = 'MYSQL_USERNAME'
Mysql:db = 'MYSQL_DATABASE'
Mysql:port = 3306
Mysql:password = 'MYSQL_PASSWORD'

Create Database using DDL Script.

Web Server Routes

  • /api/ig/sync: Route redirecting to Instagram API authorization window with defined scopes user_profile,user_media. After allowing permission access user is redirected to your defined Redirect URI.
  • /api/ig/auth: Redirect URI route, which takes code and exchanged with Access Token and then with Long-Lived Access Token. After exchange is redirected to api/ig/user/{IGUserId} route.
  • /api/ig/user/{userId}: Route which returns JSON formatted user media from Mysql Database. URL Query argument force=true can be used to force download from Instagram API.
  • /api/ig/user/{userId}/profile: Route which returns basic user information.

Execution Arguments

  • --allow-net: string : Mandatory value graph.instagram.com,api.instagram.com for allowing server to make Instagram Graph and Api Requests + your Mysql Database IP Address and your Web IP address you want this web server to run on.
  • --allow-read: string: Mandatory value .env allowing server to read environment file with credentials

Example Execution

deno run --allow-net=graph.instagram.com,api.instagram.com,127.0.0.1:3600,0.0.0.0:8000 --allow-read=.env src/http/server.ts

Usage - Import

If you want to periodically synchronize User Media feed database. You can execute following command via cron manager.

Import also takes care of renewing Access Token which will eventually expire in 60 days.

Execution Arguments

  • --allow-net: string : Mandatory value graph.instagram.com,api.instagram.com for allowing server to make Instagram Graph and Api Requests + **your Mysql Database IP Address.
  • --allow-read: string: Mandatory value .env allowing server to read environment file with credentials

Example Execution

deno run --allow-net=graph.instagram.com,api.instagram.com,127.0.0.1:3600 --allow-read=.env src/import/import.ts

deno-insta-feed's People

Contributors

janrabcan avatar

Watchers

James Cloos 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.