Skip to content

Instantly share code, notes, and snippets.

@19WAS85
Created August 8, 2008 17:16
Show Gist options
  • Save 19WAS85/4597 to your computer and use it in GitHub Desktop.
Save 19WAS85/4597 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'net/https'
@user = 'user@email.com'
@pass = 'password'
@google = Net::HTTP.new 'www.google.com', 443
@google.use_ssl = true
@google.verify_mode = OpenSSL::SSL::VERIFY_NONE
auth = @google.get("/accounts/ClientLogin?Email=#{@user}&Passwd=#{@pass}&service=orkut").body.split("\n")[2].gsub('Auth', 'auth')
@orkut = Net::HTTP.new 'www.orkut.com'
cookie_parts = @orkut.get("/RedirLogin.aspx?msg=0&#{auth}")['set-cookie'].split(';')
@cookie = "#{cookie_parts[0]};#{cookie_parts[3]};"
resp = @orkut.get('/Home.aspx', 'Cookie' => @cookie).body
File.open('resp.html', 'w') { |file| file << resp }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment