使用Zend Gdata从Google电子表格中获取数据的问题 - 结果为空

时间:2015-05-28 10:55:40

标签: php zend-framework oauth gdata

我正在尝试使用zend GData库连接Google电子表格,如下面的代码

// Google user account
$username = GOOGLE_USERNAME; // Your google account username
$password = GOOGLE_PASSWORD; // Your google account password

// Document key - get it from browser addres bar query key for your open spreadsheet

$key = GOOGLE_SPREADSHEET_KEY;

// Init Zend Gdata service

$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($username, $password, $service);
$spreadSheetService = new Zend_Gdata_Spreadsheets($client);


// Fetch recorded response data from Google Spreadsheet

try {
    // get spreadsheet entry
    $ssEntry = $spreadSheetService->getSpreadsheetEntry('https://spreadsheets.google.com/feeds/spreadsheets/' . $key);
   // get worksheets in this spreadsheet
   $wsFeed = $ssEntry->getWorksheets();
  } catch (Exception $e) {
      die('ERROR: ' . $e->getMessage());
  }

我收到以下错误:

ERROR: DOMDocument cannot parse XML: DOMDocument::loadXML(): Empty string supplied as input

问题是Google从Google API中删除了ClientLogin工具 现在我需要使用带有OAuth或OAuth2的zend GData库

请帮我这一部分,我很匆忙。

或者任何人都知道任何其他PHP解决方案来实现该解决方案。非常感激。

提前谢谢。

0 个答案:

没有答案