linkfy / Tools-for-Instagram

Automation scripts for Instagram
MIT License
499 stars 76 forks source link

Mutual followers #63

Open OmDharme opened 2 years ago

OmDharme commented 2 years ago

Is there a way to get mutual followers of an account?

rodriguesabner commented 1 year ago

you need to compare the users you follow and the ones you are following, then just check the users that match.

like this:

    const followers = await getFollowers(ig, 'rodriguesabner_');
    const followings = await getFollowing(ig, 'rodriguesabner_');

    const mutualFriends = [];
    followers
        .filter(follower => followings.some((following) => follower.pk === following.pk))
        .forEach((follower) => mutualFriends.push(follower));