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
963 stars 304 forks source link

Instagram not pulling through #284

Open Starlette opened 6 years ago

Starlette commented 6 years ago

I'm getting the following error: Uncaught TypeError: Cannot read property 'id' of undefined.

Here's the line of code it is referring to: var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?';

I am using the latest files from the repo. This is my code: instagram: { accounts: ['@toyota_sa', '#TeamHilux'], limit: 10, client_id: '30223f590b304c828cdf6178bd5d', // just hiding the last 4 digits access_token: '371047114.d90570a.0dfd8c0290fa499e83efc533bc5' // just hiding the last 4 digits },

HartLarsson commented 6 years ago

is the accounts you included yours?

htmled commented 6 years ago

Try generating a new access_token by replacing the XXXX's in the URL below. You'll need to be logged into the Instagram account you're using in order for it to work.

https://www.instagram.com/oauth/authorize/?client_id=XXX&redirect_uri=XXX&response_type=token&scope=public_content

iamzenigma commented 6 years ago

@htmled solution worked. Just to elaborate. For me, the problem lied in the fact that the access token I generated wasn't scoped as a public_content. Also to make this work, make sure to de-tick 'Disable implicit OAuth' in the options (on Instagram's Developer's website).

And if your application is in Sandbox Mode, you'll only see the feeds and tags of all the users registered in that 'Sandbox'.

ALSO: if you've got the update_period: configured in the GENERAL SETTINGS, make sure not to make it update too frequent. I've been getting another error saying that I exceeded my request limit. (The error: {"error_type": "OAuthRateLimitException", "code": 429, "error_message": "You have exceeded the maximum number of requests per hour. You have performed a total of 559 requests in the last hour. Our general maximum limit is set at 500 requests per hour."})

glucka commented 6 years ago

this tool helped me: http://services.chrisriversdesign.com/instagram-token/