twitter_listener.py 文件源码

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

项目:Seq2Seq-chatbot 作者: wataruhashimoto52 项目源码 文件源码
def tweet_listener():


    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
    api = tweepy.API(auth)

    while True:
        try:
            stream = tweepy.Stream(auth=api.auth,
                                   listener=StreamListener(api))
            print("listener starting...")
            stream.userstream()
        except Exception as e:
            print(e)
            print(e.__doc__)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号