Error while fetching Tweets with Tweepy

后端 未结 3 1325
-上瘾入骨i
-上瘾入骨i 2021-02-04 18:28

I have a Python script that fetch tweets. In the script i use the libary Tweepy . I use a valid authentication parameters. After running this script some tweets are stor

3条回答
  •  無奈伤痛
    2021-02-04 18:36

    I had this same problem, solved when I remved languages from the filter function

    since it's not yet functional, although Twitter says it is

    Instead I keep the check of the language as you did in the on_data(..)

    Also I use the on_status(..) instead of on_data(..) as follows:

    def on_status(self, status):
        ...
        tweet = json.dumps(status)
        if tweet["lang"] == "nl":
            print tweet["id"]
            Tweets.insert(tweet)
        ...
    

    Other people reported that using twitterStream.filter(track=['word'], languages=['nl']), but it didn't with me.

提交回复
热议问题