我正在使用python-twitter API,并且无论我作为user传递给下面的代码的是什么,仍然返回我的时间线,而不是所需用户的时间线。
import twitter
api = twitter.Api(consumer_key=CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET,
access_token_key=ACCESS_KEY,
access_token_secret=ACCESS_SECRET)
user = "@stackfeed"
statuses = api.GetUserTimeline(user)
print [s.text for s in statuses]当我没有将必需的字段传递给twitter.Api时,它会给我一个身份验证错误。
发布于 2013-07-18 18:56:45
您应该使用screen_name关键字参数,例如:
statuses = api.GetUserTimeline(screen_name="@gvanrossum")https://stackoverflow.com/questions/17721411
复制相似问题