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
960 stars 303 forks source link

Instagram feed has been failed #184

Open Ammet opened 8 years ago

Ammet commented 8 years ago

http://developers.instagram.com/post/145262544121/instagram-platform-update-effective-june-1-2016

Instagram feed on all my apps are crashed. Can this be this script issue? Or I should do something with Instagram app?

andreabrunato commented 8 years ago

Ok, I've solved by doing this:

ktaftaf commented 8 years ago

It works with my user account, however Im having trouble getting the above to work with hashtags. It was my impression that "scope=public_content" is all that we needed to pull hashtags. Is there something I'm missing?

I just read the discussion here https://github.com/stevenschobert/instafeed.js/issues/408

Seems this isn't going to be possible sadly.

JohJohan commented 8 years ago

@andreabrunato i am having the same problem, followd your steps but i dont get a genareted parameter on the address bar i get a 404 page. Do you have any sollutions?

Thank you

ktaftaf commented 8 years ago

@JohJohan you should be able to use Pixel Union's Token Generator http://instagram.pixelunion.net/

JohJohan commented 8 years ago

@ktaftaf Hello i did, but i still get Cannot read property 'id' of undefined, i have tried debuggin but couldnt figger out what was the problem

ktaftaf commented 8 years ago

@JohJohan Not sure whats going on then. I would make sure you have your User ID in there as well, it'll be the first 8 digits of the access token

            instagram:{
                accounts: ['@account'],
                limit: 10,
                user_id: insta_id,
                access_token: insta_token,
            },
JohJohan commented 8 years ago

@ktaftaf Thanks for repling, i call my functuion like this: ` $('#instafeed').socialfeed({

    instagram:{
        accounts: ['@denderz_nl'],       //Array: Specify a list of accounts from which to pull posts
        limit: 9,                                                //Integer: max number of posts to load
        client_id: 'xxx',           //String: Instagram client id (option if using access token)
        access_token: 'xxx'                                         //String: Instagram access token
    }

And then some other templating the error is in social.feed.js on line 515 var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; `

Where can i find my instagram id?

ktaftaf commented 8 years ago

@JohJohan My guess would be that you should remove the "client_id" and replace with "user_id". The first 8 of the access token you generated here http://instagram.pixelunion.net/ should be your "user_id"

e.g. user_id: 19241354 access_token: '19241354.1677fd0.d8358b0e24c042d6952096383b3afffa'

if that still gives you issues, make sure your user_id isnt in quotes so xxxxxxxx and not 'xxxxxxxx'

ktaftaf commented 8 years ago

@JohJohan Apparently I was mistaken, the User id isnt the first 8 digits of the access token. Someone correct me if Im wrong, but I believe its all the digits until the first . in the Access Token

JohJohan commented 8 years ago

@ktaftaf I have tried to replace the client_id to user_id, and changede it to the didgets of my acces token still doesnt work.

ktaftaf commented 8 years ago

@JohJohan Sorry man, wish I could've been more help. Maybe someone else will see this thread and help you out. Im not sure what else to recommend.

JohJohan commented 8 years ago

@ktaftaf Thats okay, i thank you for trying :)

pessato commented 8 years ago

I'm very time poor, excuse the unprofessional comment however this may help someone.

The api requests will not work if using @ in the accounts property of the Instagram settings ie: accounts: ['@apple'] due to the updates of Instgrams API discussed above. If you are desperate to get this working before contributors can update this plugin you're going to need to edit the main file jquery.socialfeed.js

line 483: url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?'; change to url = Feed.instagram.api + 'users/self/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?';

line 515: var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?'; change to var url = Feed.instagram.api + 'users/self/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?';

This combined with adding the correct access_token and user_id plus ensuring you are the owner of the account you are trying to query should do the trick, working for me anyway.

HartLarsson commented 8 years ago

i've the original script workign simply getting from here: https://www.instagram.com/developer/

CLIENT ID
CLIENT SECRET
WEBSITE URL
REDIRECT URI
SUPPORT EMAIL   

now using your CLIENT ID and REDIRECT URI call this url:

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token you will get the right TOKEN to use.

I've made this and all works.

spairous commented 8 years ago

I have the same issue and also noticed that the same problem exists in http://pavelk2.github.io/social-feed/ where I no longer see any Instagram posts returned for any tag that I use!

This seem to be a real issue that needs to be addressed by the plugin.

HartLarsson commented 8 years ago

is quite simple to discover why the demo of instagram not working. Look at the code and you will find why:

            // INSTAGRAM
            instagram: {
                accounts: queryTags,
                limit: 2,
                client_id: '88b4730e0e2c4b2f8a09a6184af2e218',
                access_token: ''
            },

the access_token is clearly missing (pavel probably don't wanna share its own because many will not use their code: lazy people always around!)