Skip to content

Instantly share code, notes, and snippets.

@geoffgarside
Forked from levinotik/gist:1334214
Created November 2, 2011 17:02
Show Gist options
  • Save geoffgarside/1334219 to your computer and use it in GitHub Desktop.
Save geoffgarside/1334219 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")
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({'Email'=> email, 'Passwd' => password,'accountType' => 'GOOGLE', 'service' => 'ac2dm', 'source' => 'myexample'})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == "https"
resp = http.request(req)
puts reps.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment