jbr - 2011-07-25
I tried to add a new function the the rest module in tcllib with this code:
set gdocs(update) { url http://docs.google.com/feeds/default/media/%docid% method put body mime_multipart headers { GData-Version 3.0 Authorization {GoogleLogin auth=%token%} Slug uploaded.txt } opt_args { ocr: } }
but I always get a 403 return code from google.
Here is the example usage that I tried:
gdocs::set_static_args -token [gdocs::auth -Email [email protected] -Passwd ***********] set meta [gdocs::create_doc_metadata -title "pmacbino-axes.html" ] set root [lindex [gdocs::doclist] 0] foreach node [$root getElementsByTagName entry] { if { [[$node getElementsByTagName title] asText] eq "pmacbino-axes.html" } { set id [[$node getElementsByTagName id] asText]; break } } set id [string map { http://docs.google.com/feeds/id/document%3A {} } $id] gdocs::update -docid document%3A$id \ -- [list {Content-Type application/atom+xml} $meta] [list {Content-Type text/plain} "This is the text doc\n By john! Added this"]