2

I am trying to download a worksheet from google spreadsheets using curl. I checked their documentation and online resources but I am still having trouble.

I obtained the key using the script below:

curl https://www.google.com/accounts/ClientLogin -d [email protected] -d Passwd=XXX -d accountType=HOSTED_OR_GOOGLE  -d source=cURL-Example -d service=wise

Which is this:

SID=DQAAAJwAAAA78qHwii5HL6TbN1se0waXBGqLWXX0cuoI7JHNzB0AlAP8e5Zz1t2oCxBgHlrVH4UY67A6vrQ9-2K2gp5l-xmpNKruvBvWQ0HvLcGO0dTJSlwY1cvOLe7PcDOdZ_AuYRoHsb_LNr_oCDRgdiHvKfVKFpPZlQvRCKPccJcHD-pMxV6MWQvmrXFUdKWN13XUC-PG7ZJ-ANCl9Z-FJ
LSID=AAJ4AAACIposyFJ0-lzRsXPGPi7zALMRSiUtUknUYT3w7b4WhvTo7YRly-YUNBwwCqb-kjt79_aAqSGG5A_tUfeBySAV0gJ-SaRU-J47fZP09e4TtFzowVfcWphdF-7xoFhl2m9_J0erE22vC33CzIER6ykPa0-Jw0_510jF2TiXNuS30Miq8kO0iXbKxfQXkYspCZyyt1bs_GAndivPsv7xi7
Auth=DQAAAJ4AAACIposyFJ0-lzRsXPGPi7zALMRSiUtUknUYT3w7b4WhvTo7YRlyYUNBwwCqkjt7Wbdh0uT_kGccEju0a-CbIwm6OfD2p6LdlrtwEua8VVJu4DSUWkuiu0-jrfTd9JCqJNNveT5-cz9tGOi5Y3KWrIfRUue1DFmCCePOz9sNSBwpOtukcjhWVsrB4E9azIuIztV8h05V-T1GBbGe0Q

After that I use the command below:

curl --silent --header "Authorization: GoogleLogin auth=DQAAAJ4AAACIposyFJ0-lzRsXPGPi7zALMRSiUtUknUYT3w7b4WhvTo7YRly-YUNBb-kjt7Wbdh0uT_kGcY1NcEju0a-CbIwm6OfD2p6LdlrtwEua8VVJu4Dkuiu0-jrfTd9JCqJNNveT5-cz9tGOi5Y3KWrIfRUue1DFmCCePOz9sNSBwpOtukcjhWVsrB4E9azIuIztV8h05V-T1GBbGe0Q" http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=0Akfdf7Ce1qZ3dFpfa4WVNlWUxrMmdTNU53cFhDZFE&hl&exportFormat=xls

When I enter the curl command above I get an error saying hl: command not found followed by a bunch of junk that the terminal can't read.

I would really appreciate if someone could tell me what I am doing wrong here or another way I can automate my downloads.

ps. I took some characters in the authentication keys since i'm not sure what data they posses and how it may be used.

Thanks

1 Answer 1

1

You need put quotes on the last argument. The '&' is being interpreted by the shell.

1
  • mjhm you are incredible. THANK YOU so much for the help. I have been loosing my sanity trying to figure out what is wrong for the past 3 days and you have saved me. Again thank you.
    – Igor
    Nov 11, 2010 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.