Example #1
0
def comment_post(client: ApiClient, media_id: str, comment: str) -> bool:
    """Leave a comment on a post.

    Args:
        client: your `ApiClient`
        media_id: the post to comment on
        comment: the comment to place

    Returns:
        `True` if success else `False`
    """
    obj = ps.Comment(media_id=media_id, comment_text=comment)
    resp = client.post_comment(obj)
    logger.info(f"Commented {comment} on post {media_id}")
    return is_resp_ok(resp)
Example #2
0
def comment_post(client: ApiClient, media_id: str, comment: str) -> bool:
    comment = ps.Comment(media_id=media_id, comment_text=comment)
    resp = client.post_comment(comment)
    logger.info(f"Commented {comment} on post {media_id}")
    return is_resp_ok(resp)
Example #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.Comment.create(media_id="1734612737423614055_6400760974",
                             comment_text="Such great!")
    client.post_comment(like)
Example #4
0
def comment_post(client: ApiClient, media_id: str, comment: str) -> bool:
    comment = ps.Comment(media_id=media_id, comment_text=comment)
    resp = client.post_comment(comment)
    return is_resp_ok(resp)