Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facing a strange problem with client.follow #777

Closed
tomarsamar opened this issue May 13, 2016 · 1 comment
Closed

Facing a strange problem with client.follow #777

tomarsamar opened this issue May 13, 2016 · 1 comment

Comments

@tomarsamar
Copy link

tomarsamar commented May 13, 2016

Twitter follow api https://api.twitter.com/1.1/friendships/create.json, does't have a hard rate limit but twitter can restrict the user if user follows hundereds of tweeps, when I used client.follow(connection_id) then it stops after following 15 tweeps and throw exception: rate limit exceeded, this should not happen as with testing twitter account I followed only 50 tweeps.
I planned to look closely and inserted some debug 'puts' at various places in the twitter and faraday gem, what I found from debug that before calling twitter follow api client.follow calls twitter friends/ids.json api and this api has rate limit of 15 calls per 15 minutes and thats why client.follow throw rate limit exception after following 15 tweeps, here is debug output

lib_ _-bash_ _204x62

  May be I am missing something here, here is my test code
 require 'twitter'

class FolowTest
    def follow(connection_id, accedd_token, access_token_secret)

      client = Twitter::REST::Client.new do |config|
        config.consumer_key = 'XXXXXXXXXXXXXX'
        config.consumer_secret     = 'XXXXXXXXXXXXXX'
        config.access_token        = 'XXXXXXXXXXXXXXX'
        config.access_token_secret = 'XXXXXXXXXXXXXX'
      end

      client.follow(connection_id)
  end
end

@tomarsamar
Copy link
Author

closing this issue as it's already resolved here --> #534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant