Get_Comment_List.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:InstagramBot 作者: JagdeepThakur 项目源码 文件源码
def get_comment_list(insta_username) :

    media_id=get_post_id(insta_username)
    request_url=BASE_URL+"media/%s/comments/?access_token=%s"%(media_id,APP_ACCESS_TOKEN)
    print "Get Requested URL:%s"%(request_url)
    comment_info=requests.get(request_url).json()

    if comment_info['meta']['code']==200 :
        if len(comment_info['data']) :
            for x in range(0,len(comment_info['data'])) :
                comment_id=comment_info['data'][x]['id']
                comment_text=comment_info['data'][x]['text']
                print Fore.BLUE+Style.BRIGHT+"Comments are %s"%(comment_text)
        else:
            print "there is no comment regarding this post"
    else :
        print "status code other than 200 found"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号