From: skim Date: 2010-09-17T14:06:16+09:00 Subject: Re: Twitter script since oAuth --00c09f9da96c6d764e04906d85ae Content-Type: text/plain; charset=ISO-8859-1 You can use the twitter gem to post once you have the oauth token or even look at this gem that does both http://github.com/moomerman/twitter_oauth On Thu, Sep 16, 2010 at 23:46, Jeff Greelish wrote: > I had a script working with basic authinecation pulling from out local > database and sending updates to twitter, about 12 a month. Not any > crazy traffic. Since Aug 31st they turned off basic authineciton. Ive > tried to implement the follow and it appears to work (pulls back a json > file per the example. Tested this by puts the line to the screen. > > I can not, figure out how to post an update to it. Im fairly new (well > not new, but dont do it full time) to programming and I must be missing > something. > > Here is the script I am following. Bottom of page for the ruby script, > just cant figure out how to pst an update to the timeline. > [code] > # Exchange your oauth_token and oauth_token_secret for an AccessToken > instance. > def prepare_access_token(oauth_token, oauth_token_secret) > consumer = OAuth::Consumer.new("APIKey", "APISecret", > { :site => "http://api.twitter.com", > :scheme => :header > }) > # now create the access token object from passed values > token_hash = { :oauth_token => oauth_token, > :oauth_token_secret => oauth_token_secret > } > access_token = OAuth::AccessToken.from_hash(consumer, token_hash ) > return access_token > end > > # Exchange our oauth_token and oauth_token secret for the AccessToken > instance. > access_token = prepare_access_token("abcdefg", "hijklmnop") > # use the access token as an agent to get the home timeline > response = access_token.request(:get, > "http://api.twitter.com/1/statuses/home_timeline.json") > [/code] > -- > Posted via http://www.ruby-forum.com/. > > --00c09f9da96c6d764e04906d85ae--