Revisions

gist: 4597 Download_button fork
public
Public Clone URL: git://gist.github.com/4597.git
Embed All Files: show embed
orkut_conn.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 }