mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
797 stars 145 forks source link

return unfollow mutual count #111

Closed Luen closed 2 years ago

Luen commented 2 years ago

Return the number of unfollows for unfollowNonMutualFollowers()

So you can do something like this:

    let unfollowedCount = await instauto.unfollowOldFollowed({ ageInDays: dontUnfollowUntilDaysElapsed, limit: options.maxFollowsPerDay * (6 / 10) });
    if (unfollowedCount > 0) await instauto.sleep(10 * 60 * 1000);

    unfollowedMutualCount += await instauto.unfollowNonMutualFollowers({ limit: options.maxFollowsPerDay * (1 / 10) });
    if (unfollowedMutualCount > 0) await instauto.sleep(10 * 60 * 1000);
    unfollowedCount += unfollowedMutualCount;

    await instauto.followUsersFollowers({
        usersToFollowFollowersOf: options.usersToFollowFollowersOf,
        maxFollowsTotal: options.maxFollowsPerDay - unfollowedCount, // unfollowOldFollowed() + unfollowNonMutualFollowers()
        skipPrivate: true,
        enableLikeImages: true,
        likeImagesMax: options.maxLikesPerUser,
    });
Luen commented 2 years ago

Probably should also return the unfollowAllUnknown() function also:

https://github.com/mifi/instauto/blob/1e6d8076489439a99d0f994b6bb58ef7b06bd1a0/src/index.js#L1037