instauto 9.1.4 → 9.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +7 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -45,6 +45,8 @@ const Instauto = async (db, browser, options) => {
|
|
|
45
45
|
followUserMinFollowers = null,
|
|
46
46
|
followUserMinFollowing = null,
|
|
47
47
|
|
|
48
|
+
shouldFollowUser = null,
|
|
49
|
+
|
|
48
50
|
dontUnfollowUntilTimeElapsed = 3 * 24 * 60 * 60 * 1000,
|
|
49
51
|
|
|
50
52
|
excludeUsers = [],
|
|
@@ -594,9 +596,7 @@ const Instauto = async (db, browser, options) => {
|
|
|
594
596
|
|
|
595
597
|
const graphqlUser = await navigateToUserAndGetData(username);
|
|
596
598
|
|
|
597
|
-
const followedByCount = graphqlUser
|
|
598
|
-
const followsCount = graphqlUser.edge_follow.count;
|
|
599
|
-
const isPrivate = graphqlUser.is_private;
|
|
599
|
+
const { edge_followed_by: { count: followedByCount }, edge_follow: { count: followsCount }, is_private: isPrivate, is_verified: isVerified, is_business_account: isBusinessAccount, is_professional_account: isProfessionalAccount, full_name: fullName, biography, profile_pic_url_hd: profilePicUrlHd, external_url: externalUrl, business_category_name: businessCategoryName, category_name: categoryName } = graphqlUser;
|
|
600
600
|
|
|
601
601
|
// logger.log('followedByCount:', followedByCount, 'followsCount:', followsCount);
|
|
602
602
|
|
|
@@ -622,6 +622,10 @@ const Instauto = async (db, browser, options) => {
|
|
|
622
622
|
logger.log('User has too many followers compared to follows or opposite, skipping');
|
|
623
623
|
return false;
|
|
624
624
|
}
|
|
625
|
+
if (shouldFollowUser !== null && (typeof shouldFollowUser === 'function' && !shouldFollowUser({ username, isVerified, isBusinessAccount, isProfessionalAccount, fullName, biography, profilePicUrlHd, externalUrl, businessCategoryName, categoryName }) === true)) {
|
|
626
|
+
logger.log(`Custom follow logic returned false for ${username}, skipping`);
|
|
627
|
+
return false;
|
|
628
|
+
}
|
|
625
629
|
|
|
626
630
|
await followUser(username);
|
|
627
631
|
|