Got some problem with OAuth, code working at home but not at work (Error: Invalid Oauth token)


#1

Hi all,

I’ve been trying the simpliest thing to work but it’s not working. I’ve tried the same code with Windows 8, Ubuntu running on VM on that Windows 8 and with an other PC with XP at work. It gives me that tweepy error: "Unable to get username, invalid oauth token!"
On the other hand it worked perfectly with my home PC…

Any suggestions? I can only think about a problem with the internet conexion because the code is working in one place but not in the other

Much thanks in advance.

import tweepy

consumer_key="consumer_key"
consumer_secret="consumer_secret"
access_token="access_token"
access_token_secret=“access_token_secret”

auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)

print api.me().name


#2

Solved after realising I had checked the time on my PC was fine but date was a day ahead without any apparent reason.


#3

┐( ∵ )┌フライングゲット