Hi,

I'm trying to get a server app to tweet messages to one specific
account I own. I'm following Twitter's instructions on Twitter's wiki:
http://developer.twitter.com/pages/oauth_single_token#ruby

I can read information from twitter (e.g. get last 20 tweets), but
when I try to update my status I get the error "Could not authenticate
with OAuth" in the body of the 401 response.

The simplified code I'm using is below. Key , secret, access token and
secret are all copied from my twitter application page on
developer.twitter.com. OAuth gem version 0.4.3.

Any thoughts or suggestions?

------
consumer = OAuth::Consumer.new("MY KEY", "MY SECRET", { :site =>
"http://api.twitter.com";, :scheme => :header })

token_hash = { :oath_token => "MY ACCESS TOKEN", :oauth_token_secret
=> "MY ACCESS SECRET"}
access_token = OAuth::AccessToken.from_hash(consumer, token_hash)

res = access_token.get("/statuses/update.xml", {"status" => "Hello
tweet"})
-----


Response:
<Net::HTTPUnauthorized 401 Unauthorized readbody=true>


thanks,

Eran

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk?hl=en

Reply via email to