计算一组 Twitter 用户的关注者 [英] Counting a Group of Twitter Users' Followers
问题描述
我想设置一个应用程序,该应用程序将检索所有关注者的 ID,计算每个人拥有的关注者数量,并求和总数.
I'm wanting to setup an app that will retrieve all follower's IDs, count how many followers each has, and sum the total.
示例:MyAccount > MyFollowersAccount > follower_count
Example: MyAccount > MyFollowersAccount > followers_count
我想为每个关注者执行此操作,然后将他们拥有的关注者总数相加.所以如果我有 100 个关注者,而我的关注者有 100 个关注者,我应该得到 10,000 个关注者或 10,100(包括我自己的)的回报值.
I want to do this for each follower and then add the total amount of followers they all have. So if I have 100 followers and my followers have 100 followers, I should get a return value of 10,000 followers or 10,100 (including my own).
我很难弄清楚如何对多个用户执行此操作.我见过可以检索单个用户的方法,但我担心可能会遍历 1,000 个关注者.
I am having difficulty figuring out how to do this with multiple users. I've seen ones that will retrieve a single user, but I'm worried about looping through potentially 1,000 of followers.
有什么想法或建议吗?
推荐答案
MyAccount > MyFollowersAccount > follower_count
MyAccount > MyFollowersAccount > followers_count
我要做的是这个,
运行 Twitter API 方法 GET 关注者/ids
run the Twitter API method GET followers/ids
https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=twitterapi
获取网名X的粉丝ID
然后切换到 Twitter Counter 这将为您提供更详细的列表和关于关注者的信息,特别是关注者.此外,这可能是一种拆分两个调用的方法,这样您就不会被一端的速率限制问题阻止.
and then switch over to Twitter Counter which will give you a more detailed list and information about the followers, followers specifically. Also, this could be a way to split up the two calls so you won't be blocked by a rate limit problem on one end.
http://twittercounter.com/pages/api?ref=footer
这篇关于计算一组 Twitter 用户的关注者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!