I've been working with Python Twitter Tools and haven't had any problems authenticating with the REST API through this library.
But when I try to authenticate with the Streaming API, I get nothing but 401 HTTP Unauthorized errors.
Similar to the website my code is as follows:
stream = TwitterStream(
auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET,
CONSUMER_KEY, CONSUMER_SECRET)
)
stream.statuses.sample()
I've tried:
Double checking my Tokens/Keys -- I know they're right because I can authenticate using the same tokens and keys through the same library to the REST API.
Double checking my permissions level -- I even purposely changed it to Read, Write & Direct Messages, still doesn't work.
Also, I looked on the Twitter Dev website and it says that I only need OAuth in order to authenticate with the Streaming API, so I don't think its a problem with that either. I only need access to the public stream, nothing higher than that.
Checked that I have the latest version of the library -- I do.
Any suggestions would be helpful! :)