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 working #321

Open H1r1n opened 6 years ago

H1r1n commented 6 years ago

The Instagram is not working because of the new API endpoints. Will there be a new fixed version for this?

H1r1n commented 6 years ago

To fix the Cannot read property 'id' of undefined issue for Instagram, because the user is undefined, change this line 487 url = Feed.instagram.api + 'users/search/?q=' + username + '&' + authTokenParams + '&count=1' + '&callback=?';

with this line: url = Feed.instagram.api + 'users/self/?' + authTokenParams + '&count=1' + '&callback=?';

and the Instagram should work again

wedot commented 6 years ago

I get an error from line 513. var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?';

How can that be fixed?

H1r1n commented 6 years ago

As from the update of the Instagram API endpoints you can no longer get the posts from other users. So you should change the request URL to match YOUR user ( the one that you have Auth token from) . Change the current one: var url = Feed.instagram.api + 'users/' + user.id + '/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?';

With this: var url = Feed.instagram.api + 'users/self/media/recent/?' + authTokenParams + '&' + 'count=' + options.instagram.limit + '&callback=?';