我对Python和Tweepy非常陌生。在
我想,比如说,看看我收到的所有DMs的文本。在
import tweepy
consumer_key = "XXXX"
consumer_secret = "YYY"
access_token = "ZZZ"
access_token_secret = "AAA"
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
since_id = "11223344556677889"
#This is the ID of a month-old DM. I want to get "all" DMs since then, tho I think I'm limited to 200 per call huh?
direct_messages = tweepy.Cursor(api.direct_messages, since_id=since_id).items()
for dm in direct_messages:
print dm.text
这是最近的200个DMs。那不是我想要的。我要旧的DMs,从身份证开始
FWIW,我知道DM存在,因为它正确地返回它:
^{pr2}$
看起来这是一个twitter API限制:
https://dev.twitter.com/rest/reference/get/direct_messages
相关问题 更多 >
编程相关推荐