MCPcopy
hub / github.com/InstaPy/InstaPy / interact_by_comments

Method interact_by_comments

instapy/instapy.py:5475–5835  ·  view source on GitHub ↗

Like comments of people on posts, reply to them and also interact with those commenters

(
        self,
        usernames: list = None,
        posts_amount: int = 10,
        comments_per_post: int = 1,
        reply: bool = False,
        interact: bool = False,
        randomize: bool = False,
        media: str = None,
    )

Source from the content-addressed store, hash-verified

5473 Settings.yandex_config.update(enabled=False)
5474
5475 def interact_by_comments(
5476 self,
5477 usernames: list = None,
5478 posts_amount: int = 10,
5479 comments_per_post: int = 1,
5480 reply: bool = False,
5481 interact: bool = False,
5482 randomize: bool = False,
5483 media: str = None,
5484 ):
5485 """
5486 Like comments of people on posts, reply to them
5487 and also interact with those commenters
5488 """
5489 if self.aborting:
5490 return self
5491 message = "Starting to interact by comments.."
5492 highlight_print(self.username, message, "feature", "info", self.logger)
5493
5494 if not isinstance(usernames, list):
5495 usernames = [usernames]
5496
5497 if media not in [MEDIA_PHOTO, MEDIA_VIDEO, None]:
5498 self.logger.warning(
5499 "Unknown media type- '{}' set at"
5500 " Interact-By-Comments!\t~treating as any..".format(media)
5501 )
5502 media = None
5503
5504 # hold the current global values for differentiating at the end
5505 liked_init = self.liked_img
5506 already_liked_init = self.already_liked
5507 liked_comments_init = self.liked_comments
5508 commented_init = self.commented
5509 replied_to_comments_init = self.replied_to_comments
5510 followed_init = self.followed
5511 already_followed_init = self.already_followed
5512 inap_img_init = self.inap_img
5513 not_valid_users_init = self.not_valid_users
5514
5515 overall_posts_count = 0
5516 self.quotient_breach = False
5517 like_failures_tracker = {
5518 "consequent": {"post_likes": 0, "comment_likes": 0},
5519 "limit": {"post_likes": 5, "comment_likes": 10},
5520 }
5521
5522 leave_msg = "\t~leaving Interact-By-Comments activity\n"
5523
5524 # start the interaction!
5525 for s, username in enumerate(usernames):
5526 if self.quotient_breach:
5527 break
5528
5529 message = "User: [{}/{}]".format(s + 1, len(usernames))
5530 highlight_print(
5531 self.username, message, "user iteration", "info", self.logger
5532 )

Callers

nothing calls this directly

Calls 11

validate_user_callMethod · 0.95
feature_in_featureMethod · 0.95
interact_by_usersMethod · 0.95
highlight_printFunction · 0.85
get_links_for_usernameFunction · 0.85
check_linkFunction · 0.85
get_comments_on_postFunction · 0.85
like_imageFunction · 0.85
text_analysisFunction · 0.85
like_commentFunction · 0.85
comment_imageFunction · 0.85

Tested by

no test coverage detected