winbot.py 文件源码

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

项目:winbot-twitter-bot 作者: jflessau 项目源码 文件源码
def follow_user(screen_name):
    follows = get_list('follows.txt')
    add = True
    for stored_screen_name in follows:
        if screen_name == stored_screen_name:
            add == False
    if add == True:
        unfollow_add = unfollow_fifo()
        try:
            twitter.create_friendship(screen_name=screen_name)
            add_line(screen_name, 'follows.txt')
            print 'followed ' + screen_name.encode('ascii', 'ignore')
        except TwythonError as e:
            print 'FAILED to follow ' + screen_name.encode('ascii', 'ignore')
        return (unfollow_add + 1)
    else:
        return unfollow_add
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号