dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Method accountFollowers does not sort output by date added #1290

Open bumsun opened 4 years ago

bumsun commented 4 years ago

Early, this code returned a sorted list of followers by date added. Now the response is returned in random order.

var followersFeed = ig.feed.accountFollowers(id);
var wholeResponse = await followersFeed.request();
Nerixyz commented 4 years ago

Sadly, there's no option to set the ordering of this feed. There is however an option to set the ordering on the following feed.

bumsun commented 4 years ago

Sadly, there's no option to set the ordering of this feed. There is however an option to set the ordering on the following feed.

I saw a branch, thanks!)

bumsun commented 4 years ago

Sadly, there's no option to set the ordering of this feed. There is however an option to set the ordering on the following feed.

Am I adding this option correctly? Sorting doesn't work. I am testing on a user with 300 following. ig.feed.accountFollowing(id,{order:"date_followed_latest"});

Nerixyz commented 4 years ago

Sorting doesn't work.

As i said, the option exists but won't work everywhere. Maybe it will do in the future. But this library can't do anything about it other than using the regular parameters.

tadeohepperle commented 4 years ago

Hey Nerix, first of all, thanks for the great work you and dilame are doing. So If I want to check if someone subscribed during the last 24h the only solution I can think of right now would be to keep track of all new followers by subscribing to push notifications using your FBNS-Client. Am I getting this right?

rainb3rry commented 4 years ago
var wholeResponse = await followersFeed.request();

btw, your whole response is not a whole, that's for just 100 you can grab whole like that;

const followersFeed = ig.feed.accountFollowers(id);

  var all_followers = [];
  followersFeed.items$.subscribe(
    followers => all_followers = all_followers.concat(followers),
    error => console.error(error),
    () => {
      fs.writeFileSync('out.txt', JSON.stringify(all_followers))
    },
  );
Nerixyz commented 4 years ago

btw, your whole response is not a whole, that's for just 100 you can grab whole like that;

I'd guess "whole" refers to the actual response vs the items.

rainb3rry commented 4 years ago

I'd guess "whole" refers to the actual response vs the items.

well, do you think when can we get smoothly ordered following & followers data of an user?

rainb3rry commented 3 years ago

Sadly, there's no option to set the ordering of this feed. There is however an option to set the ordering on the following feed.

Am I adding this option correctly? Sorting doesn't work. I am testing on a user with 300 following. ig.feed.accountFollowing(id,{order:"date_followed_latest"});

it should be like this, ig.feed.accountFollowing({id: id, order:"date_followed_latest"}); and it can only work for your own account not for others with that API but you can do whatever you want with instagram web api now.