MCPcopy
hub / github.com/InstaPy/InstaPy / grab_following

Method grab_following

instapy/instapy.py:4554–4601  ·  view source on GitHub ↗

Gets and returns `following` information of given user in desired amount, also, saves locally

(
        self,
        username: str = None,
        amount: int = None,
        live_match: bool = False,
        store_locally: bool = True,
    )

Source from the content-addressed store, hash-verified

4552 return grabbed_followers
4553
4554 def grab_following(
4555 self,
4556 username: str = None,
4557 amount: int = None,
4558 live_match: bool = False,
4559 store_locally: bool = True,
4560 ):
4561 """
4562 Gets and returns `following` information of given user
4563 in desired amount, also, saves locally
4564 """
4565
4566 message = "Starting to get the `Following` data.."
4567 highlight_print(self.username, message, "feature", "info", self.logger)
4568
4569 if username is None:
4570 self.logger.warning(
4571 "Please provide a username to grab `Following` data"
4572 " ~e.g. your own username or somebody else's"
4573 )
4574 return self
4575
4576 elif amount is None:
4577 self.logger.warning("Please put amount to grab `Following` data")
4578 return self
4579
4580 elif amount != "full" and (
4581 type(amount) != int or ((type(amount) == int and amount <= 0))
4582 ):
4583 self.logger.info(
4584 "Please provide a valid amount bigger than"
4585 " zero (0) to grab `Following` data"
4586 )
4587 return self
4588
4589 # get `following` data
4590 grabbed_following = get_following(
4591 self.browser,
4592 self.username,
4593 username,
4594 amount,
4595 self.relationship_data,
4596 live_match,
4597 store_locally,
4598 self.logger,
4599 self.logfolder,
4600 )
4601 return grabbed_following
4602
4603 def pick_unfollowers(
4604 self,

Callers

nothing calls this directly

Calls 2

highlight_printFunction · 0.85
get_followingFunction · 0.85

Tested by

no test coverage detected