Twitter script since oAuth

J

Jeff Greelish

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top