Exemplo n.º 1
0
def get_likers_of_post(client: ApiClient, media_id: str) -> List[dict]:
    """Get users that liked a post.

    Args:
        client: your `ApiClient`
        media_id: the post to retrieve the likers from

    Returns:
        A list of Instagram user objects (objects/user.json).
    """
    logger.info(f"Getting likers of {media_id}")
    return client.post_get_likers(RetrieveLikers(media_id))
Exemplo n.º 2
0
def get_commenters_of_post(client: ApiClient,
                           media_id: str) -> List[models.User]:
    """Get users that commented on a post.

    Args:
        client: your `ApiClient`
        media_id: the post to retrieve the commenters from

    Returns:
        A list of Instagram user objects (objects/post.json).
    """
    logger.info(f"Getting commenters of {media_id}")
    return [
        models.User.parse(l)
        for l in client.post_get_likers(RetrieveLikers(media_id))
    ]
Exemplo n.º 3
0
import os

from instauto.api.client import ApiClient

if __name__ == '__main__':
    if os.path.isfile('./.instauto.save'):
        client = ApiClient.initiate_from_file('./.instauto.save')
    else:
        client = ApiClient(username=os.environ.get("INSTAUTO_USER")
                           or "yourusername",
                           password=os.environ.get("INSTAUTO_PASSWORD")
                           or "yourpassword")
        client.log_in()
        client.save_to_disk("./.instauto.save")

    retrieved_data = client.post_get_likers("1770154859660826272")

    print(retrieved_data)
Exemplo n.º 4
0
def get_likers_of_post(client: ApiClient, media_id: str) -> List[dict]:
    logger.info(f"Getting likers of {media_id}")
    return client.post_get_likers(RetrieveLikers(media_id))
Exemplo n.º 5
0
def get_likers_of_post(client: ApiClient, media_id: str) -> List[dict]:
    return client.post_get_likers(media_id)