Closed botsbuzz closed 7 years ago
Try Like this
.then(function(results) { var media = _.flatten(results); console.log(media) }
Perfect! Thank you!
Are you getting total result of page or partial data of page
Partial data.
I'm looking to understand the feed SelfLiked. Do you know the meaning?
@botsbuzz posts liked by you ;)
@huttarichard Thank you for the reply. It was what I was hoping. but it gives me the wrong results (posts to which I never put a like)
@huttarichard This is my code:
Client.Session.create(device, storage, myUsername, myPassword)
.then(function(session) {
// Now you have a session, we can follow / unfollow, anything...
// And we want to follow Instagram official profile
return [session, Client.Account.searchForUser(session, username)]
})
.spread(function(session, account) {
session = session;
console.log(account.id);
//return Client.Relationship.create(session, account.id);
var feed = new Client.Feed.SelfLiked(session, account.id);
Promise.mapSeries(_.range(0, 20), function() {
return feed.get();
})
.then(function(results) { var media = _.flatten(results); console.log(media) });
}) //spread
Try like this
`var accountId = 'yourid' var feed = new Client.Feed.SelfLiked(session,accountId); get_total_data(); function get_totaldata() { Promise.map(.range(0, 1), function() { return feed.get(); }) .then(function(results) {
console.log(results)
if(feed.isMoreAvailable() == true) { var next_cursor=feed.getCursor() console.log('next_cursor :'+next_cursor); feed.setCursor(next_cursor); get_total_data(); } }) }`
@anjaneyulu-nyros great! thank you! It works but return posts to which I never put a like. this is just a problem of mine?
The Feed API example return me tons of "undefined". Here the code: