0

基本上尝试使用 twython 库来关注其他用户的关注者

我是 twitter、python 和 pwython 的新手,所以请记住这一点。

Atm 使用 'get_friends_ids' 并能够检索 id 号码列表。

问题是我不知道如何分解并遵循所有这些。

我该怎么办!?

我到目前为止的工作..

oauth working..

t = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
tysfriends = t.get_friends_ids(screen_name="fucktyler")
print tysfriends

这不起作用: t.create_friendship(user_id = tysfriends)

我想添加 lis tof 朋友 'tysfriends'

4

1 回答 1

1

以下代码应该可以工作

t = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
tysfriends = t.get_friends_ids(screen_name="fucktyler")
for friend_id in tysfriends['ids']:
    t.create_friendship(user_id=friend_id)

感谢您使用 Twython!

于 2013-06-21T01:42:44.743 回答