Twitter API - get tweets with specific id

前端 未结 4 2055
再見小時候
再見小時候 2020-12-23 21:07

I have a list of tweet ids for which I would like to download their text content. Is there any easy solution to do this, preferably through a Python script? I had a look at

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-23 21:44

    I don't have enough reputation to add an actual comment so sadly this is the way to go:

    I found a bug and a strange thing in chrisinmtown answer:

    Every 100th tweet will be skipped due to the bug. Here is a simple solution:

            if len(tweet_ids) < 100:
                tweet_ids.append(tweet_id)
            else:
                tweet_ids.append(tweet_id)
                get_tweet_list(twapi, tweet_ids)
                tweet_ids = list()
    

    Using is better since it works even past the rate limit.

    api = tweepy.API(auth_handler=auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
    

提交回复
热议问题