twython icon indicating copy to clipboard operation
twython copied to clipboard

401 on stream, but REST works fine

Open karan opened this issue 12 years ago • 5 comments

http://stackoverflow.com/questions/23986148/twython-401-on-stream-but-rest-works-fine

NO KIDDING. My code was working yesterday

So I'm writing a script to get streaming data using twython. But today it's giving me 401 errors. Even with the example code

I tried new keys, and a new app, but it still gives me 401.

However, normal REST api interface in Twython (see next code block) works just fine.

twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
print twitter.get_home_timeline()

Some Googlefu led me to this SO thread which suggested using ntpd -q, but this doesn't solve my issue!

karan avatar Jun 02 '14 01:06 karan

I've been running a stream for the past month basically continuously on the streaming API, no problems. An hour or so ago it crashed. It also crashed via an R script I had running on the streaming API... so it may be a bigger problem than just Twython...

nickobradovich avatar Jun 02 '14 02:06 nickobradovich

I tried the script on Heroku and it seemed to work with the same keys. What is going on?

karan avatar Jun 02 '14 14:06 karan

Twitter stream seemed to be down... all my streams are working fine now. Maybe try again?

On Mon, Jun 2, 2014 at 7:08 AM, Karan Goel [email protected] wrote:

I tried the script on Heroku and it seemed to work with the same keys. What is going on?

— Reply to this email directly or view it on GitHub https://github.com/ryanmcgrath/twython/issues/330#issuecomment-44840908.

nickobradovich avatar Jun 02 '14 15:06 nickobradovich

My first suggestion would have been resetting the time on your server as well. The streaming API may have just had some blips in it as @nobradovich suggested?

michaelhelmick avatar Jun 02 '14 15:06 michaelhelmick

Same issue here, even stranger situation though. Worked like a charm until a week ago, then stopped. Moved to another server, upgraded to Python 2.7.6, streams do not work (other endpoints work). The amazing thing is that it seems to work on my dev setup (python 2.7.5+). Any ideas what might be the cause? I am thinking there might be some issues with oauth or requests, but don't really have any clue (since all the errors I get are 401s from Twitter).

lesingerouge avatar Jun 18 '14 20:06 lesingerouge