Randomly pick users for giveaways on Instagram.
Clone this repo and run yarn install
, yarn start
and then go to http://localhost:3000 to view and test app.
- This app is in sandbox mode as Instagram declined the app registration request. Therefore, it now only works with my account.
oembed
endpoint is broken today (August 7th, 2017) and I am fairly sure it's the Instagram API's problem, as the embed button disappeared on every post, andget
requests to the endpoint gives 404 response code.
I use create-react-app that easily set up the whole project as a React
app.
Set up Reactstrap to use bootstrap 4 components in as React components.
To add Reactstrap
and update dependencies properly, I ran:
$ yarn add [email protected]
$ yarn add react-addons-transition-group react-addons-css-transition-group
$ yarn add reactstrap
Then followed the instructions by adding
import 'bootstrap/dist/css/bootstrap.css';
in src/index.js
, and any component (button as an example) that you would like to use with
import { Button } from 'reactstrap';
in src/App.js
.
The routing system is done by using react-router. The routes are specified in src/App.js
.
The Instagram API uses OAuth 2.0 protocol.
As GitHub only hosts static websites, this projects uses client-side/implicit authentication with the help of react-router for redirecting.
The access token is stored persistently by using localStorage.
Requests are made by using fetch-jsonp
. XMLHttpRequests have cross-domain restrictions (a request from one domain to another will not succeed) as Instagram API does not have access-control-allow-origin
in the headers.
Travis CI for build status. More tests to come.