require 'net/http'
require 'uri'
url = URI.parse('http://twitter.com/statuses/update.xml')
url.user = "your username"
url.password = "your password"
res = Net::HTTP.post_form(url, {'status' => "hello world"})
puts res.body
Just two requires are needed before getting your hands dirty. Next is setting up Basic Authentication on the URI and posting with a single parameter of 'status'. Job done. View the result in XML or JSON through the update extension in the URI.
No comments:
Post a Comment