【发布时间】:2015-07-26 22:36:09
【问题描述】:
我有这段代码可以使用 Twython 吸引我的 Twitter 关注者。我将如何修改它来代替:
“获取所有未出现在静音关注者列表中的 Twitter 关注者”?
我尝试了两次请求,一次针对关注者,一次针对 twitter.list_mutes,然后将两个列表作为集合进行比较。但是 twitter api 对此并不满意。
建议?
followers = []
next_cursor = -1
while(next_cursor):
get_followers = twitter.get_followers_list(screen_name=username, count=200, cursor=next_cursor)
for follower in get_followers["users"]:
followers.append(follower["screen_name"].encode("utf-8"))
next_cursor = get_followers["next_cursor"]
print "%s followers found" % str(len(followers))
【问题讨论】:
标签: python python-2.7 twitter twython