TypeError:GetHomeTimeline()获取关键字参数'count'的多个值

时间:2013-08-03 17:26:45

标签: python python-2.7 twitter

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]

1 个答案:

答案 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]