controller.py 文件源码

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

项目:instagramBot 作者: mcclane 项目源码 文件源码
def clean(username, password, delay, b=None): # works for only me!
    if(b==None):
        b = Bot(username, password)
    with open("mcclanewhitelist.txt", "r") as f:
        whitelist = { line.split(" ")[0] : line.split(" ")[1] for line in f.readlines() }
    time.sleep(2)
    follower_count = b.get_follower_count(b.id)
    print("Followers: "+str(follower_count))
    following_count = b.get_following_count(b.id)
    print("Following: "+str(following_count))
    followers_list = b.get_followers(b.id, follower_count)
    following = b.get_following(b.id, following_count)
    followers = {}
    for thing in followers_list:
        followers[thing['node']['id']] = 1

    for thing in following:
        print(thing)
        if not thing['node']['id'] in followers:
            b.unfollow(thing['node']['id'])
            time.sleep(delay)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号