duanchi0897 2015-05-28 10:55
浏览 19

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

I am trying to connect with Google spreadsheet using zend GData library as below code

// 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());
  }

I am getting below error :

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

Problem is Google removed ClientLogin facility from google API Now I need to use zend GData library with OAuth or OAuth2

Please help me in this part, am in little hurry.

Or anybody knows any other PHP solution to achieve the solution. It will be very grateful.

Thank you in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数