lib/googleapi MDL-24111 - Google Docs Repository Broken

This seems to be related to problems at googles end with perhaps
the api not being correctly implemented to start with. Particularly the
docID was incorrect.

I think google worked around the problem with a redirect which the curl
download_file downloaded rather than followed the redirect.
This commit is contained in:
Dan Poltawski
2010-09-07 20:40:09 +00:00
parent cec7ffcab9
commit b1ebc904ff
+3 -4
View File
@@ -294,9 +294,8 @@ class google_docs {
$files = array();
foreach($xml->entry as $gdoc){
$docid = (string) $gdoc->children('http://schemas.google.com/g/2005')->resourceId;
list($type) = explode(':', $docid);
list($type, $docid) = explode(':', $docid);
$title = '';
$source = '';
@@ -306,11 +305,11 @@ class google_docs {
switch($type){
case 'document':
$title = $gdoc->title.'.rtf';
$source = 'http://docs.google.com/feeds/download/documents/Export?docID='.$docid.'&exportFormat=rtf';
$source = 'http://docs.google.com/feeds/download/documents/Export?id='.$docid.'&exportFormat=rtf';
break;
case 'presentation':
$title = $gdoc->title.'.ppt';
$source = 'http://docs.google.com/feeds/download/presentations/Export?docID='.$docid.'&exportFormat=ppt';
$source = 'http://docs.google.com/feeds/download/presentations/Export?id='.$docid.'&exportFormat=ppt';
break;
case 'spreadsheet':
$title = $gdoc->title.'.xls';