====================
A button for your website allowing users to quickly follow you on instagram
You can check out a working demo here: http://jelled.com/instagram/instafollow
- You must create an instagram api client. This can be done at http://instagram.com/developer/
- When setting up a new client you should point the REDIRECT URI to the locaton of the "instafollow-redirect-uri.html" file
- Create a button in your html markup with an id of "instaFollow"
- Include the file "instafollow.js" in your html
Set the following variables in "instafollow.js"
- instaUserName: set to your instagram username
- instaUserID: set to your instagram numeric id. You can look it up here: http://jelled.com/instagram/lookup-user-id
- instaClientID: the client id of the api client you registered above in step 1.
- instaRedirectURI: set to the location of the "instafollow-redirect-uri.html" file. For example: http://www.yoursite.com/instafollow-redirect-uri.html
To give you an idea of what's going on here is a summary of the application flow:
- When the instaFollow is clicked an instagram authentication window will open asking your user whether they will allow access to your api client.
- Assuming access is granted by the user, the popup window will be redirected to your REDIRECT URI which should be "instafollow-redirect-uri.html".
- The redirect uri will be appended with an instagram api access token.
- The access token is then passed to a second api request along with your instagram numeric user id and the follow relationship is complete.