我正在使用tweepy来访问大量的推文。很多推文都被截断了,所以我想得到一些推文的全文,我有这个推文。
我的问题是:tweepy api实例有一种方法可以一次下载多个推文(api.statuses_lookup),但这会返回截断的推文。它还有一个方法,包括完整的推文文本(api.get_status),但afaik一次只发一条推文。有没有办法一次获得多个推文的全文?
import tweepy
consumer_key = "XXX"
secret = "XXX"
auth = tweepy.AppAuthHandler(consumer_key, secret)
auth.secure = True
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
ids = [1108360183586140161, 1108474125486641153]
# Finds tweets (up to 100 at a time), but doesn't contain extended text
foo = api.statuses_lookup(ids)
# Returns tweet, including extended text, but only for one at a time
bar = api.get_status(1108449077937635328, tweet_mode='extended')