pavelk2 / social-feed

JavaScript plugin that shows a user feed from the most popular social networks
http://pavelk2.github.io/social-feed-example/
MIT License
962 stars 304 forks source link

Instagram broken - code block never reached - client_id authentication deprecated #142

Closed brettdorrans closed 8 years ago

brettdorrans commented 8 years ago

I can't get the Instagram feed to work properly - passing client_id always returns 400 "The access_token provided is invalid" as the client_id isn't an access_token as per the Instagram API.

When generating an access_token and providing this, we still encounter that the access_token is invalid as line 372 of jquery.socialfeed.js reads:

query_extention = 'client_id=' + options.instagram.client_id + '&' + limit + '&callback=?',

When it should read:

query_extention = 'access_token=' + options.instagram.client_id + '&' + limit + '&callback=?',

When changing this URL endpoint we successfully authenticate and return the user data from the Instagram API. However, the getUsers function has a code block that is never reached:

getUsers: function(json, username) {
    json.data.forEach(function(user) {
        if (user.username == username) {
            // NEVER REACHED as username == "success"
            var url = igm_api_base + 'users/' + user.id + '/media/recent/?' + query_extention;
            Utility.request(url, Feed.instagram.utility.getImages);
        }
    });
},

Is this a bug?

brettdorrans commented 8 years ago

After some investigation, it looks like the update to the Instagram API a few days ago deprecates client_id authentication for newly created apps:

http://instagram.com/developer/changelog/