There is an entry on how to use Curl with google services:
http://code.google.com/apis/gdata/articles/using_cURL.html#other-tools
Following this, the first step would be:
curl ^
-k ^
--proxy <your_proxy_here> ^
https://www.google.com/accounts/ClientLogin ^
--data-urlencode Email=hellonico@gmail.com ^
--data-urlencode Passwd=<cant_tell_you> ^
-d accountType=GOOGLE ^
-d source=Google-cURL-Example ^
-d service=lh2
This will returns you something like:
SID=<long_string_1>
LSID=<long_string_2>
Auth=<long_string_3>
Now you can use that token directly to authenticate and access Google Services. Accessing Picassa in read, would be:
curl ^
--silent ^
--header "Authorization: GoogleLogin auth=<long_string_3>" ^
"http://picasaweb.google.com/data/feed/api/user/default"
And to update data, using a PUT or POST:
curl ^
--silent ^
--request POST ^
--data-binary "@template_entry.xml" ^
--header "Content-Type: application/atom+xml" ^
--header "Authorization: GoogleLogin auth=<long_string_3" ^
"http://picasaweb.google.com/data/feed/api/user/brad.gushue"
The same applies to Google Location, you just need to ask for a GoogleAPI first and then head to the documentation explaining how to post data.
The POST needs something like this:
POST https://www.googleapis.com/latitude/v1/location?key=INSERT-YOUR-KEY
/* Authorization header here */
Content-Type: application/json
{
"data": {
"kind":"latitude#location",
"timestampMs":"1274057512199",
"latitude":37.420352,
"longitude":-122.083389,
"accuracy":130,
"altitude":35
}
}
There you go.
In this post, all the ^ marks, means EOL, and are used to split all those long commands over multiple lines.