Hello Guys,
i have pulled the repo to the npm install and its installed successfully.
When i tried to get UserStory feeds its returning empty array. I have tried the below code. Anyone can help me out on this. But, when i tried with PHP api its working.
var userStory = new Client.Feed.UserStory(session, 123456);
userStory.get().then(media => {
console.log(media);
});
First off, don't pass it an integer, but an array, so that would be new Client.Feed.UserStory(session, [123456]); if you only want one.
There seems to currently be a bug. The feed tries to return data.items but that is no longer correct, as instagram passes you data.reels and data.reels_media. Have a look at user-story.js. A quick and dirty fix is changing line 24 and onward to something like:
.then(function (data) {
if (!data.reels_media.length) return [];
var media = _.map(data.reels_media[0].items, function (medium) {
return new Media(that.session, medium);
});
return media;
});
Disclaimer: It's a quick and dirty fix, for only one user, no guarantees. If I can find some free time I'll do a proper fix and submit a pull request.
Hi Ziao,
Thank you very much i found the integer to array trick. Also found the error on user-story.js i have did the same quick fix like you.
If you found the proper fix please update me as well as.
Thank you
Hi Ziao,
It's been a very useful comment!
The same bug exists in Client.Feed.StoryTray
Here we should read data.tray
Thanks
Most helpful comment
First off, don't pass it an integer, but an array, so that would be
new Client.Feed.UserStory(session, [123456]);if you only want one.There seems to currently be a bug. The feed tries to return
data.itemsbut that is no longer correct, as instagram passes youdata.reelsanddata.reels_media. Have a look at user-story.js. A quick and dirty fix is changing line 24 and onward to something like:Disclaimer: It's a quick and dirty fix, for only one user, no guarantees. If I can find some free time I'll do a proper fix and submit a pull request.