Ruby on rails with twitter integration

after i searched, i got so many links related with the twitter
integration ,
Then i do that with one following link

after some steps with the rails console, *Then i got some errors after i
gave the steps to send the tweet from the application *

  • client = Twitter::Client.new*,

=> #<Twitter::Client:0x971204c @adapter=:net_http, @consumer_key=nil,
@consumer_secret=nil, @endpoint=“https://api.twitter.com/”,
@format=:json,
@gateway=nil, @oauth_token=nil, @oauth_token_secret=nil, @proxy=nil,
@search_endpoint=“https://search.twitter.com/”, @user_agent=“Twitter
Ruby
Gem 1.7.2”, @media_endpoint=“https://upload.twitter.com/”,
@faraday_options={}>

  • client.update(‘Test post from the console’)*

Twitter::Unauthorized: POST
https://api.twitter.com/1/statuses/update.json:
401: Could not authenticate you.
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/faraday/response/raise_http_4xx.rb:12:in
on_complete' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/response.rb:9:inblock in call’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/response.rb:62:in
on_complete' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/response.rb:8:incall’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/request/url_encoded.rb:14:in
call' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/request/multipart.rb:13:incall’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/faraday/request/multipart_with_file.rb:18:in
call' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/connection.rb:207:inrun_request’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/faraday-0.7.5/lib/faraday/connection.rb:94:in
post' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/request.rb:27:inrequest’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/request.rb:10:in
post' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/twitter-1.7.2/lib/twitter/client/tweets.rb:45:inupdate’
from (irb):23
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in
start' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:8:instart’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:40:in
<top (required)>' from script/rails:6:inrequire’
from script/rails:6:in `’

plz send some links to start the integration with twitter…

Thank u
Vishnu

You need to enter your app keys, have you registered your app with
twitter?

yes, i have registered. Have any other stuffs to follow this?

Can i use this link??
http://functino.com/2010/02/twitter-api-with-rails/

but, when i give this Twitter.post(:update, :status => “Via ROR”), got
the
error

ActiveResource::UnauthorizedAccess: Failed. Response code = 401.
Response
message = Unauthorized.
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/connection.rb:132:in
handle_response' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/connection.rb:115:inrequest’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/connection.rb:98:in
block in post' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/connection.rb:218:inwith_auth’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/connection.rb:98:in
post' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/activeresource-3.1.1/lib/active_resource/custom_methods.rb:63:inpost’
from (irb):2
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in
start' from /home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/console.rb:8:instart’
from
/home/cyberpro/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:40:in
<top (required)>' from script/rails:6:inrequire’
from script/rails:6:in `’

Hi, amvis,

Isn’t it an error of just wrong username/password?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs