| Store | Cart

HTTPClient can't login to Google Voice

From: Mike Telis <mte...@gmail.com>
Wed, 4 Aug 2010 02:26:16 +0900
I'm trying to login to Google Voice using the following code:


require 'httpclient'

Google_Login    = 'googlename'
Google_Password = 'password'

PRE_LOGIN_URL   = "https://www.google.com/accounts/ServiceLogin"
LOGIN_URL       = "https://www.google.com/accounts/ServiceLoginAuth"
VOICE_HOME_URL  = "https://www.google.com/voice"

clnt = HTTPClient.new(:agent_name => "Mozilla/5.0 (Macintosh; U; Intel
Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2")
#clnt.debug_dev = STDERR

resp = clnt.get PRE_LOGIN_URL

clnt.cookie_manager.cookies.each {|x| @galx=x.value if x.name == 'GALX'}
# fetch GALX

resp = clnt.post_content  LOGIN_URL,
                  :service  => 'grandcentral',
                  :continue => 'https://www.google.com/voice',
                  :Email    => Google_Login,
                  :Passwd   => Google_Password,
                  :GALX     => @galx

and post_content ends up redirecting to non-https URL (which is
definitely wrong). BTW, I believe that post_content should change method
to :get on redirect.

Any ideas what might be wrong with the code (or library)?
-- 
Posted via http://www.ruby-forum.com/.

Recent Messages in this Thread
Mike Telis Aug 03, 2010 05:26 pm
Jason Watson Aug 03, 2010 06:31 pm
Mike Telis Aug 03, 2010 07:16 pm
Jason Watson Aug 03, 2010 08:06 pm
Mike Telis Aug 03, 2010 08:21 pm
Jason Watson Aug 03, 2010 08:50 pm
Mike Telis Aug 04, 2010 03:32 am
Mike Telis Aug 05, 2010 03:59 am
Mike Telis Aug 05, 2010 04:47 am
Messages in this thread