0
import simplejson
import httplib2
import twitter

api = twitter.Api(consumer_key='consumer key', consumer_secret='consumer secret', access_token_key='access token', access_token_secret='token secret')

timeline = api.GetHomeTimeline('@username', count=20, since_id=None, max_id=None, trim_user=False, exclude_replies=False, contributor_details=False, include_entities=True)

print [s.text for s in statuses]
4

1 回答 1

0

GetHomeTimeline()方法不需要用户名;它为当前经过身份验证的用户返回推文。删除第一个参数:

timeline = api.GetHomeTimeline(count=20, since_id=None, max_id=None, trim_user=False, exclude_replies=False, contributor_details=False, include_entities=True)

print [s.text for s in timeline]
于 2013-08-03T17:32:49.510 回答