querying Google.Groups
I did some googling, and came to the script below, Can anyone help /me and give a clue why this wont log me in to groups.google.com ?
#!/bin/bash
tmp=$$.tmp
EMAIL=<email>
PASSWD=<password>
curl -vv --silent https://www.google.com/accounts/ServiceLoginAuth \
--user-agent "Mozilla 5.0" \
--data-urlencode Email=$EMAIL --data-urlencode Passwd=$PASSWD \
-c cookie.tmp \
-d accountType=GOOGLE \
-d source=Google-cURL-Example \
-d service=groups2 > $tmp
auth=`grep Auth $tmp | sed 's/.*开发者_如何学编程=//'`
curl --silent \
--user-agent "Mozilla 5.0" \
--header "Authorization: GoogleLogin auth=$auth" \
-b cookie.tmp \
"http://groups.google.com/group/comp.lang.javascript/topics" > $tmp>
cat $tmp
rm $tmp
I haven't worked directly with /ServiceLoginAuth
, but from my work with /Login
and /AddSession
, my guess is that you are missing some hidden form values used to secure the login.
In this case, I would look at the hidden #gaia_universallogin
form and attempt to replicate the login flow:
- Hit
https://www.google.com/accounts/ServiceLoginAuth
. It returns you a form with idgaia_universallogin
that contains login tokens. - Set the POST data to reflect each header of that form, as well as the
Email
andPasswd
fields (like you are doing now) - Set the
continue
parameter (if you like) and POST the request. You will either be returned a google settings page or the continue page if you've logged in, or a page with another login form if you aren't.
In this case, I suspect you are missing the dsh
token.
精彩评论