gpt4 book ai didi

zend-framework - 将 Zend_Gdata_Spreadsheets 用于公共(public)电子表格?

转载 作者:行者123 更新时间:2023-12-02 02:35:42 25 4
gpt4 key购买 nike

我有这段有效的代码,用于加载 Google 电子表格并从中加载一些数据。如果有问题的电子表格是公开的,我该如何修改代码以不需要用户名/密码?

$key="keytothespreadsheet";
$user="test@example.com";
$pass="*****";

$authService = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$httpClient = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $authService);
$gdClient = new Zend_Gdata_Spreadsheets($httpClient);
$query = new Zend_Gdata_Spreadsheets_DocumentQuery();
$query->setSpreadsheetKey($key);
$feed = $gdClient->getWorksheetFeed($query);
print_r($feed);

最佳答案

在下一行中,HTTP 客户端是可选的:

$gdClient = new Zend_Gdata_Spreadsheets($httpClient);


所以,不要通过它。以下是等价的:

$gdClient = new Zend_Gdata_Spreadsheets();
// or
$gdClient = new Zend_Gdata_Spreadsheets(null);
// or
$gdClient = new Zend_Gdata_Spreadsheets(new Zend_Http_Client());

关于zend-framework - 将 Zend_Gdata_Spreadsheets 用于公共(public)电子表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1905412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com