将 Zend GData 库与 OAuth 和 Picasa 结合使用

发布于 2025-01-05 10:33:25 字数 1056 浏览 0 评论 0原文

我正在尝试使用 zend gdata 库(用于 picasa)和一些 oauth 凭据来获得一些简单的工作。所以我不知道我是否正确地传递了 OAuth 内容,每当我去创建一个画廊时,它都会在尝试查找不存在的“/Zend/Gdata/Photos/Extension/Title.php”时失败。标题确实存在于 App/Extension/Title.php 下。不确定这是否与我在 oauth 中添加的方式有关,或者是否是自动加载器的问题......

$oauthOptions = array(
//'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
'version' => '2.0',
'signatureMethod' => 'HMAC-SHA1',
'consumerKey' => $CONSUMER_KEY,
'consumerSecret' => $CONSUMER_SECRET
);
$consumer = new Zend_Oauth_Consumer($oauthOptions);
$service = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$accessToken = new Zend_Oauth_Token_Access();
$accessToken->setToken('1/cIxUGEzJtHMt58coKjKEJBBRJV6KFinqpBXl8fX9OG_8');
$accessToken->setTokenSecret('Ykl2junbg06Uy5MncejtmKIy');

$httpClient = $accessToken->getHttpClient($oauthOptions);
$service = new Zend_Gdata_Photos($httpClient); //, "yourCompany-YourAppName-v1"
$entry = new Zend_Gdata_Photos_AlbumEntry();
$entry->setTitle($service->newTitle("test album"));
$service->insertAlbumEntry($entry);

I am trying to jus get something simple to work using the zend gdata library (for picasa) and some oauth credentials. So I have not idea if I'm passing in the OAuth stuff correctly, and whenever I go to create a gallery it fatals out trying to find '/Zend/Gdata/Photos/Extension/Title.php' which doesn't exist. Title does exist under App/Extension/Title.php. Not sure if it's related to how I'm adding in oauth, or if it's a problem with the autoloader....

$oauthOptions = array(
//'requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER,
'version' => '2.0',
'signatureMethod' => 'HMAC-SHA1',
'consumerKey' => $CONSUMER_KEY,
'consumerSecret' => $CONSUMER_SECRET
);
$consumer = new Zend_Oauth_Consumer($oauthOptions);
$service = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$accessToken = new Zend_Oauth_Token_Access();
$accessToken->setToken('1/cIxUGEzJtHMt58coKjKEJBBRJV6KFinqpBXl8fX9OG_8');
$accessToken->setTokenSecret('Ykl2junbg06Uy5MncejtmKIy');

$httpClient = $accessToken->getHttpClient($oauthOptions);
$service = new Zend_Gdata_Photos($httpClient); //, "yourCompany-YourAppName-v1"
$entry = new Zend_Gdata_Photos_AlbumEntry();
$entry->setTitle($service->newTitle("test album"));
$service->insertAlbumEntry($entry);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文