errorInvalid / used nonce - Twitter oauth - Ruby on Rails
I have a server which is polling for mentions from Twitter.开发者_StackOverflow中文版 It works great in my test environment, but in production it started to fail after a while.
I use the twitter_oauth gem 0.4.0. I cant see whats different in production.
client = TwitterOAuth::Client.new(
:consumer_key => 'k7P---------gTQ',
:consumer_secret => 'PDWa-------------ThaOBM',
:token => '1608769-------------------------igwp0YzHslh',
:secret => '00L-------------------------CZfZTt0'
)
last_index = self.fetch_message_index
s = client.mentions
It worked for a while, but now it just works in the test-environment.
It turned out that the time was out of sync on my server. When I adjusted the clock, everything started to work again.
精彩评论