只读应用程序无法使用twitter ruby​​ gem进行POST

时间:2013-09-12 20:28:14

标签: ruby twitter

我有以下ruby脚本:

puts "Checkpoint 1"
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

Twitter.configure do |config|
    config.consumer_key = 'xxxxxxxxxxxxxx'
    config.consumer_secret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    config.oauth_token = 'xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    config.oauth_token_secret = 'xxxxxxxxxxxxxxxxxxxxxxx'
end
Twitter.verify_credentials
puts "Checkpoint 2"
Twitter.update("It is a Myth That Entrepreneurs Drive New Technology http://www.slate.com/articles/health_and_science/new_scientist/2013/09/entrepreneurs_or_the_state_innovation_comes_from_public_investment.html")
puts "Checkpoint 3"

它到达检查点2但不到达检查点3,它会出现以下错误:

  

只读应用程序无法POST

但事实并非如此,因为当我访问dev.twitter.com并检查我的应用程序的偏好时,它说:

  

访问级别读取,写入和直接消息

所以没有只读的东西。我完全迷失在这里,可能是什么问题?

谢谢!

1 个答案:

答案 0 :(得分:4)

据我所知,有两个可能简单的解释。在将应用程序从只读更改为读/写后,您可能没有更新访问令牌。或者,您的电子邮件地址尚未经过验证。