Note that there are some explanatory texts on larger screens.

plurals
  1. POTweeting using Twitter gem and Omniauth
    primarykey
    data
    text
    <p>I'm developing a web app that will let users tweet posts and links, but I can't seem to get Twitter and Omniauth to play nicely together. I'm currently running on Rails 3.0.6 and Ruby 1.8.7, with the Twitter gem 1.4.1 and Omniauth gem 0.2.5</p> <p>I can authenticate the users fine, but when it comes to sending a tweet, I'm just given the error:</p> <pre><code> POST https://api.twitter.com/1/statuses/update.json: 401: Incorrect signature </code></pre> <p>I followed <a href="http://blog.assimov.net/post/2358661274/twitter-integration-with-omniauth-and-devise-on-rails-3" rel="nofollow">this tutorial</a>, and have placed my consumer key and consumer secret in a Twitter configure block in my Omniauth initializer, but not the oauth token or oauth secret because these will surely be used on a per-user basis.</p> <p><em>omniauth.rb</em></p> <pre><code> Twitter.configure do |config| config.consumer_key = "XXXXXXXXXXXXXXXXXXXXXX" config.consumer_secret = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" end </code></pre> <p><em>user.rb</em></p> <pre><code> def twitter unless @twitter_user provider = self.authentications.find_by_provider('twitter') @twitter_user = Twitter::Client.new(:oauth_token =&gt; provider.token, :oauth_token_secret =&gt; provider.secret) rescue nil end @twitter_user end </code></pre> <p>I then form the request using:</p> <pre><code> current_user.twitter.update("Hello World!") </code></pre> <p>And that's what then gives me the 401 error.</p> <p>Any ideas? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload