/ Published in: jQuery
Logging In with InstaLib
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Create New Instance of the class. Pass your ClientID, Callback URL and location of PHP Proxy Script ( Included with Library ) var instagram = new Instagram("45a0c872bc884a848ea73e12c9bd33b7", "your website", "instalib.php"); // Check to see if the user has logged in before by checking Local Storage Cache. If they havent, send them to authorize you're application. If so, retrieve the userToken and begin if( instagram.getCachedToken() === false ){ instagram.getToken(); console.log("New Token: " + instagram.accessToken); } console.log("Cached Token if not New: " + instagram.accessToken); //Login Button $("button.authorize_button").on( "click", function(){ console.log("CLICKED"); // Send user to Instagram to authorize your application. Optional Permissions can be sent as an array. instagram.authorize(["likes","comments","relationships"]); });