require 'rest_client'
authresponse=RestClient.post('https://www.google.com/accounts/ClientLogin', :service=>'reader',:Email=>email,:Passwd=>password,:source=>'mreader',:continue=>'http://www.google.com')
if authresponse=~/SID=(.*)/
sid=$1
end
xml=RestClient.get("http://www.google.com/reader/atom/user/-/state/com.google/reading-list", {:Cookie=>"SID=#{sid}"})
As you can see REST Client makes the REST methods GET and POST (also DELETE and PUT) really easy.
No comments:
Post a Comment