from twython import Twython
twitter = Twython()
followers = twitter.getFollowersIDs(screen_name = "ryanmcgrath")
followers = followers['ids']
print "The user rayanmcgrath has %s followers" % str(len(followers))
for follower_id in followers:
print "User with ID %d is following ryanmcgrath" % follower_id
from twython import Twython
twitter = Twython()
followers = twitter.getFollowersIDs(screen_name = "ryanmcgrath")
for follower_id in followers:
print "User with ID %d is following ryanmcgrath" % follower_id
试试这个:
有两种不同的方法可以用于此目的;一种只返回跟随者id(
getFollowersIDs
),另一种返回跟随者集(getFollowersStatus
)的状态/etc。在其中的一些示例代码如下所示:
如果您有id,则需要自己进行进一步的查找,因此后一种方法(
getFollowersStatus
)可能是您想要的。请记住,Twython函数只是从官方Twitter API文档镜像API键参数,因此可以传递给参数的方法与在文档中找到的方法相同。在相关问题 更多 >
编程相关推荐