MCPcopy
hub / github.com/InstaPy/InstaPy / interact_user_following

Method interact_user_following

instapy/instapy.py:3458–3633  ·  view source on GitHub ↗
(
        self, usernames: list, amount: int = 10, randomize: bool = False
    )

Source from the content-addressed store, hash-verified

3456 return self
3457
3458 def interact_user_following(
3459 self, usernames: list, amount: int = 10, randomize: bool = False
3460 ):
3461
3462 if self.aborting:
3463 return self
3464
3465 if self.do_follow is not True and self.do_like is not True:
3466 self.logger.info(
3467 "Please enable following or liking in settings"
3468 " in order to do interactions."
3469 )
3470 return self
3471
3472 elif self.user_interact_amount <= 0:
3473 self.logger.info(
3474 "Please choose an amount higher than zero in"
3475 " `set_user_interact` in order to do interactions."
3476 )
3477 return self
3478
3479 if not isinstance(usernames, list):
3480 usernames = [usernames]
3481
3482 interacted_all = 0
3483 not_valid_users = 0
3484 simulated_unfollow = 0
3485
3486 # hold the current global values for differentiating at the end
3487 liked_init = self.liked_img
3488 already_liked_init = self.already_liked
3489 commented_init = self.commented
3490 followed_init = self.followed
3491 inap_img_init = self.inap_img
3492
3493 self.quotient_breach = False
3494
3495 for index, user in enumerate(usernames):
3496 if self.quotient_breach:
3497 break
3498
3499 self.logger.info(
3500 "User '{}' [{}/{}]".format((user), index + 1, len(usernames))
3501 )
3502 try:
3503 person_list, simulated_list = get_given_user_following(
3504 self.browser,
3505 self.username,
3506 user,
3507 amount,
3508 self.dont_include,
3509 randomize,
3510 self.blacklist,
3511 self.follow_times,
3512 self.simulation,
3513 self.jumps,
3514 self.logger,
3515 self.logfolder,

Callers

nothing calls this directly

Calls 6

validate_user_callMethod · 0.95
feature_in_featureMethod · 0.95
interact_by_usersMethod · 0.95
get_given_user_followingFunction · 0.85
unfollow_userFunction · 0.85
sleepFunction · 0.85

Tested by

no test coverage detected