I figured it out.  The trick was to make sure the account you are posting to
is also the account where you register the app (it won't work if you just
have the keys). Then, just take the four keys (see below) and use the
following code:

Twitter.configure do |config|
  config.consumer_key = 'YOUR_CONSUMER_KEY'
  config.consumer_secret = 'YOUR_CONSUMER_SECRET'
  config.oauth_token = 'YOUR_OAUTH_TOKEN'
  config.oauth_token_secret = 'YOUR_OAUTH_TOKEN_SECRET'
end

client = Twitter::Client.new
client.update('Hello, from Twitter Gem!')

On Fri, Nov 12, 2010 at 8:14 PM, Curious Yogurt
<starempireel...@gmail.com>wrote:

> I have a Rails 3 app that I would like to tweet certain status reports
> and so on. I am using the Twitter Gem. I have all the API keys and so
> on, and can actually tweet to a logged-in users account. But this
> isn't what I want to do.
>
> I want the app to tweet to its own account, "in the background" so to
> speak. So, when the user does something, the app should tweet to its
> own account (not the user's) "this has been done."
>
> It occurs to me that maybe this isn't possible with oauth.  Is there
> any way to do this? Thank you.
>
> --
> 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
>

-- 
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

Reply via email to