コード例 #1
0
def like_post(client: ApiClient, media_id: str) -> bool:
    """Like a post.

    Args:
        client: your `ApiClient`
        media_id: the post to like

    Returns:
        `True` if success else `False`
    """
    like = ps.Like(media_id=media_id)
    resp = client.post_like(like)
    logger.info(f"liked post {media_id}")
    return is_resp_ok(resp)
コード例 #2
0
ファイル: post.py プロジェクト: Samu1808/instauto
def like_post(client: ApiClient, media_id: str) -> bool:
    like = ps.Like(media_id=media_id)
    resp = client.post_like(like)
    logger.info(f"liked post {media_id}")
    return is_resp_ok(resp)
コード例 #3
0
import os

from instauto.api.client import ApiClient
from instauto.api.actions import post as ps

if __name__ == '__main__':
    if os.path.isfile('./.instauto.save'):
        client = ApiClient.initiate_from_file('./.instauto.save')
    else:
        client = ApiClient(user_name=os.environ.get("INSTAUTO_USER")
                           or "your_username",
                           password=os.environ.get("INSTAUTO_PASS")
                           or "your_password")
        client.login()
        client.save_to_disk('./.instauto.save')

    like = ps.Like.create(media_id="1734612737423614055_6400760974")
    client.post_like(like)
コード例 #4
0
ファイル: post.py プロジェクト: b177y/instauto
def like_post(client: ApiClient, media_id: str) -> bool:
    like = ps.Like(media_id=media_id)
    resp = client.post_like(like)
    return is_resp_ok(resp)