これを機能させようとすると、非常にイライラします。基本的に、これはzend gdataフレームワークを含めることができないサイト(x10hosting.com)用であるため、phpcURLでGoogleDataAPIを使用してアクセスしようとしています。私ができることのほとんどは、次のスクリプトを使用して、提供されたユーザー名ワークシートのリストを返すことです。
<?php
// Construct an HTTP POST request
$clientlogin_url = "https://www.google.com/accounts/ClientLogin";
$clientlogin_post = array(
"accountType" => "HOSTED_OR_GOOGLE",
"Email" => "", //username
"Passwd" => '', //password
"service" => "writely",
"source" => "your application name"
);
// Initialize the curl object
$curl = curl_init($clientlogin_url);
// Set some options (some for SHTTP)
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $clientlogin_post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Execute
$response = curl_exec($curl);
// Get the Auth string and save it
preg_match("/Auth=([a-z0-9_\-]+)/i", $response, $matches);
$auth = $matches[1];
echo "The auth string is: ".$auth;
// Include the Auth string in the headers
// Together with the API version being used
$headers = array(
"Authorization: GoogleLogin auth=".$auth,
"GData-Version: 3.0",
);
// Make the request
$key = ;
curl_setopt($curl, CURLOPT_URL, "https://spreadsheets1.google.com/ccc?key=$key");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, false);
$response = curl_exec($curl);
curl_close($curl);
var_dump($response);
// Parse the response
$response = simplexml_load_string($response);
// Output data
foreach($response->entry as $file)
{
echo "File: " . $file->title . "<br />";
echo "Type: " . $file->content["type"] . "<br />";
echo "Author: " . $file->author->name . "<br /><br />";
}
?>
しかし、これを使用して1つの特定のワークシートにアクセスする方法がわかりません。助けてください、これは私を狂わせています。
編集: DASPRiDのアドバイスに従うと、このエラーが発生します->
注意:Zend_Loader :: Zend_Loader :: registerAutoloadは1.8.0で非推奨になり、2.0.0で削除されます。代わりに、266行目の/home/c3webdev/public_html/library/Zend/Loader.phpでZend_Loader_Autoloaderを使用します
警告:require_once(Zend / Loader / Autoloader.php)[function.require-once]:ストリームを開くことができませんでした:/home/c3webdev/public_html/library/Zend/Loader.phpの267行目にそのようなファイルまたはディレクトリはありません
致命的なエラー:require_once()[function.require]:必要な'Zend / Loader / Autoloader.php'(include_path ='/ home / c3webdev / public_html / library:。:/ usr / lib / php:/ usr / local /home/c3webdev/public_html/library/Zend/Loader.phpの267行目の/lib/ php')