How do I know which tracked accounts were followers of my Twitter account?

I need to calculate the majority of subsequent accounts as followers of this account .

I found the first answer, but I have strong limitations: the friends / ids API speed limit is 15 calls per second for 15 minutes . I can wait every time I press the speed limit, but so, I need 10 hours to analyze 600 Twitter subscribers.

require "rubygems" require "twitter" Twitter.configure do |config| config.consumer_key = CONSUMER_KEY config.consumer_secret = CONSUMER_SECRET config.oauth_token = OAUTH_TOKEN config.oauth_token_secret = OAUTH_TOKEN_SECRET end results = Hash.new(0) Twitter.follower_ids(TWITTER_ACCOUNT_TO_ANALYSE).ids.each do |account| Twitter.friend_ids(account).ids.each do |id| results[id] +=1 end end puts results.sort_by {|key, value| value}.inspect 

Do you know a more interesting way or API to calculate it? An approximate answer may be sufficient for my use.

EDIT:

Here is the version that controls the speed limit and does not display solitaire:

 require "rubygems" require "twitter" Twitter.configure do |config| config.consumer_key = CONSUMER_KEY config.consumer_secret = CONSUMER_SECRET config.oauth_token = OAUTH_TOKEN config.oauth_token_secret = OAUTH_TOKEN_SECRET end results = Hash.new(0) Twitter.follower_ids(TWITTER_ACCOUNT_TO_ANALYSE).ids.each do |account| begin Twitter.friend_ids(account).ids.each do |id| results[id] +=1 end rescue Twitter::Error::TooManyRequests => error #rate limit sleep error.rate_limit.reset_in retry rescue Twitter::Error::Unauthorized => error #protected account next end end puts results.sort_by {|key, value| value}.keep_if {|key, value| value > 1}.inspect 
+4
source share
1 answer

I am well versed in the Twitter API (albeit with Python, not Ruby), and as far as I know, you are out of luck here - in fact there are no restrictions on these speed limits for the API.

You are not the only one who is unhappy with this development. I, like many other developers, commented on this issue here - given that people on Twitter did not indicate that these restrictions will change, it is probably safe to assume that they are here to stay.

With the exception of paying third-party data providers that may have all of this data, you basically get stuck 15 calls in 15 minutes.

On the other hand, if, as you said, you are looking for an approximate answer, you can get away with accepting a (statistically significant) sample of supporters of the original account. You did not indicate how many followers there are for the original account, so I can’t tell you the number of accounts that you will need to select, but obviously there is no reason to pull this data for all followers, assuming that the original account you want analyze, has a fairly large number of followers.

I suppose, as a last resort, you could use several IP addresses and Twitter accounts to expedite this work, but there is a decent amount of work that you would have to do for this, and it works against the spirit, if not the letter if the terms of service of Twitter.

I'm with you, though - 15 calls in 15 minutes for these friends / followers is not good.

+1
source

Source: https://habr.com/ru/post/1445337/


All Articles