Skip to content

Instantly share code, notes, and snippets.

@levinotik
Created November 2, 2011 17:00
Show Gist options
  • Save levinotik/1334214 to your computer and use it in GitHub Desktop.
Save levinotik/1334214 to your computer and use it in GitHub Desktop.
require 'net/https'
require 'uri'
email = ARGV[0]
password = ARGV[1]
uri = URI.parse("https://google.com/accounts/ClientLogin")
http = Net::HTTP::Post.new(uri.host, uri.port)
http.set_form_data({'Email'=> email, 'Passwd' => password,'accountType' => 'GOOGLE', 'service' => 'ac2dm', 'source' => 'myexample'})
http.use_ssl = true if uri.scheme == "https"
http.start {
http.request_get(uri.path) {|res|
print res.body
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment