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]
答案 0 :(得分: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]