【发布时间】:2019-04-24 00:48:01
【问题描述】:
我正在使用 Twython twitter API 来提取推文。但我只收到 100 条推文。我想提取从 2013 年 12 月 10 日到 2014 年 3 月 10 日的推文。我在搜索功能中提到了 count=1000。
速率限制是 100,我明白了。有没有办法在给定的时间段内获取这些推文而没有任何速率限制。
from twython import Twython
import csv
from dateutil import parser
from dateutil.parser import parse as parse_date
import datetime
from datetime import datetime
import pytz
utc=pytz.UTC
APP_KEY = 'xxxxxxxxxxx'
APP_SECRET = 'xxxxxxxxxxx'
OAUTH_TOKEN = 'xxxxxxxx' # Access Token here
OAUTH_TOKEN_SECRET = 'xxxxxxxxxxx'
t = Twython(app_key=APP_KEY, app_secret=APP_SECRET, oauth_token=OAUTH_TOKEN, oauth_token_secret=OAUTH_TOKEN_SECRET)
search=t.search(q='AAPL', count="1000",since='2013-12-10')
tweets= search['statuses']
for tweet in tweets:
do something
【问题讨论】: