我刚开始学习使用 twitter api 1.1 制作应用程序。我想获得一个用户的 3200 条推文,但我不知道如何添加分页?请问你能告诉我解决方法吗?这是我的代码。我只收了 198 条推文。
import oauth2 as oauth
import json
# Twitter API documentation
# https://dev.twitter.com/docs/api/1.1
# Get access tokens from https://dev.twitter.com/docs/auth/tokens-devtwittercom
consumer_key = ''
consumer_secret = ''
access_token = ''
access_secret = ''
consumer = oauth.Consumer(key=consumer_key, secret=consumer_secret)
token = oauth.Token(key=access_token, secret=access_secret)
client = oauth.Client(consumer, token)
header, response = client.request('https://api.twitter.com/1.1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=username&count=500')
print len(json.loads(response))