Perform ClientLogin using curl


Requests an authorization token for one of the Google Data API services and stores it in the shell environment variable GDATA_AUTH. This shell script takes three command line parameters, the email address for the desired account, password, and the service name of the service which the token will be used to access.
#!/bin/sh
export GDATA_AUTH=`curl 2>/dev/null https://www.google.com/accounts/ClientLogin \
  -d Email=$1 -d Passwd=$2 -d accountType=HOSTED_OR_GOOGLE -d source=curlExample \
  -d service=$3 | grep '^Auth=' | cut -c 6-`
echo $GDATA_AUTH