MCPcopy
hub / github.com/InstaPy/InstaPy / interact_user_followers

Method interact_user_followers

instapy/instapy.py:3081–3264  ·  view source on GitHub ↗

Interact with the people that a given user is followed by. set_do_comment, set_do_follow and set_do_like are applicable. :param usernames: List of users to interact with their followers. :param amount: Amount of followers to interact with. :param randomize:

(
        self, usernames: list, amount: int = 10, randomize: bool = False
    )

Source from the content-addressed store, hash-verified

3079 return self
3080
3081 def interact_user_followers(
3082 self, usernames: list, amount: int = 10, randomize: bool = False
3083 ):
3084 """
3085 Interact with the people that a given user is followed by.
3086
3087 set_do_comment, set_do_follow and set_do_like are applicable.
3088
3089 :param usernames: List of users to interact with their followers.
3090 :param amount: Amount of followers to interact with.
3091 :param randomize: If followers should be chosen randomly.
3092 """
3093
3094 if self.aborting:
3095 return self
3096
3097 if self.do_follow is not True and self.do_like is not True:
3098 self.logger.info(
3099 "Please enable following or liking in settings in order to "
3100 "do interactions."
3101 )
3102 return self
3103
3104 elif self.user_interact_amount <= 0:
3105 self.logger.info(
3106 "Please choose an amount higher than zero in "
3107 "`set_user_interact` in order to do interactions."
3108 )
3109 return self
3110
3111 if not isinstance(usernames, list):
3112 usernames = [usernames]
3113
3114 interacted_all = 0
3115 not_valid_users = 0
3116 simulated_unfollow = 0
3117
3118 # hold the current global values for differentiating at the end
3119 liked_init = self.liked_img
3120 already_liked_init = self.already_liked
3121 commented_init = self.commented
3122 followed_init = self.followed
3123 inap_img_init = self.inap_img
3124
3125 self.quotient_breach = False
3126
3127 for index, user in enumerate(usernames):
3128 if self.quotient_breach:
3129 break
3130
3131 self.logger.info(
3132 "User '{}' [{}/{}]".format((user), index + 1, len(usernames))
3133 )
3134 try:
3135 person_list, simulated_list = get_given_user_followers(
3136 self.browser,
3137 self.username,
3138 user,

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_followersFunction · 0.85
unfollow_userFunction · 0.85
sleepFunction · 0.85

Tested by

no test coverage detected