0
votes

I'm wanting to setup an app that will retrieve all follower's IDs, count how many followers each has, and sum the total.

Example: MyAccount > MyFollowersAccount > followers_count

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).

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.

Any ideas or suggestions?

1
You want to see how many followers a user who tweets a particular hash tag has? Am I getting it right? - Chamilyan
Well, that will come later. More specifically, I want to track how many followers my followers have. So the hierarchy is like MyAccount > MyFollowersAccount > followers_count. I want to do this for each follower and then get a total followers count. As an example: If I have 100 followers and they each have 100 followers, I should get a total of 10,100 followers (including my own). - Brett
How is this difficult? You can loop over the users or just parallelize the queries to different threads or different CPUs. - Iterator

1 Answers

0
votes

MyAccount > MyFollowersAccount > followers_count

What I would do is this,

run the Twitter API method GET followers/ids

https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=twitterapi

to get the ID's of the followers of screenname X

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