sferik / twitter-ruby

A Ruby interface to the Twitter API.
http://www.rubydoc.info/gems/twitter
MIT License
4.58k stars 1.31k forks source link

User Timeline (Twitter::Error::Unauthorized) — Error raised when supplied user credentials are not valid. #954

Closed brusacco closed 1 year ago

brusacco commented 5 years ago

Hello, I have this issue when I cycle like 100 or 200 Twitter accounts like this:

` client = Twitter::REST::Client.new do |config| config.consumer_key = "xxx" config.consumer_secret = "xxx" config.access_token = "xxx" config.access_token_secret = "xxx" end

begin loop here 100 or 200 accounts

client.user_timeline(user.uid,{:count=>50}).each do |tweet| save_tweet(tweet)
end

end loop

` It authenticate well using the credentials initially. But after a while it gives that error: "Twitter::Error::Unauthorized"

I have tried to rescue from that error, wait a couple of minutes and then call Client.new again, but not luck, same error ... I'm no getting close to the rate limits, just 200 o 300 accounts timelines to check.

Any help here thanks!

brusacco commented 5 years ago

Anyone can help with this error?

qnm commented 5 years ago

@brusacco We're seeing a similar issue with fetch_mentions_timeline. Have you made any progress in your understanding of the problem?

brusacco commented 5 years ago

Hello, in my particular case, the error was because some accounts where private ones, sorry for not getting back on this ... but after filtering those ones, we have no more problems.