我在应用Google混合协议(OpenID + OAuth)后成功检索了令牌密钥/密钥.
然后我在这里查看Zend文档:http: //framework.zend.com/manual/en/zend.gdata.html
...以及此处的Calendar API示例:http: //code.google.com/googleapps/marketplace/tutorial_php.html#Integrate-OAuth
他们提到Zend_Gdata库支持的AuthSub方法(特别是在我所能看到的Zend_Gdata_HttpClient类中).
但我无法弄清楚如何使用Hybrid方法检索的密钥/秘密令牌来访问日历源.
上面提到的示例使用AuthSub身份验证,而Google建议尽可能切换到OAuth,而不是使用AuthSub.
有任何想法吗?谢谢.
我想允许任何人在我的网站上注册,在我自己的YouTube用户频道上传他们的视频.
我不希望他们评论任何视频或任何需要他们自己的登录凭据的内容.
我应该使用:ClientLogin授权吗?
如果是这样,我如何获得令牌以便我可以允许我的网站与我的YouTube频道帐户进行互动?
这里的任何灯都会非常感激,因为我有点迷失在这里.
当用户将事件添加到在线日历时,他们也可以添加到Outlook日历中(同步).显然,使用PHP构建的站点无法直接与桌面应用程序集成,因此我正在寻找其他选择.
我找到的选项:
问题:
我一直在使用Zend Gdata一段时间了,今天我得到了一个错误
Notice: Undefined offset: ClientLogin.php on line 150
Run Code Online (Sandbox Code Playgroud)
通过PHP,这已经工作了一段时间,今天没有改变任何它停止工作,我猜代表谷歌的一些弃用服务与zend gdata可能的Zend_Gdata_ClientLogin::getHttpClient( )方法或东西,可以任何人确认或帮助我这个问题.我用来连接的代码如下:
require_once('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Docs');
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
require_once 'Zend/Gdata.php';
require_once 'Zend/Gdata/AuthSub.php';
require_once 'Zend/Gdata/Spreadsheets.php';
require_once 'Zend/Gdata/Spreadsheets/DocumentQuery.php';
require_once 'Zend/Gdata/Spreadsheets/ListQuery.php';
require_once 'Zend/Loader.php';
$sourceUser = "myemail";
$sourcePass = "mysuperawesomepassword";
$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$sourceClient = Zend_Gdata_ClientLogin::getHttpClient($sourceUser, $sourcePass, $service);
$connection = new Zend_Gdata_Spreadsheets($sourceClient);
Run Code Online (Sandbox Code Playgroud)
我正在使用谷歌电子表格的zend gdata
错误也指向此行
$sourceClient = Zend_Gdata_ClientLogin::getHttpClient($sourceUser, $sourcePass, $service);
Run Code Online (Sandbox Code Playgroud)
就像我说的那样,我现在已经使用了一段时间,而我的结局并没有改变
我试图在PHP中使用Gcal API.
我正在使用ZEND框架
function getAuthSubUrl($company)
{
$next = "http://$company.mysite.com";
$scope = 'http://www.google.com/calendar/feeds/';
$secure = false;
$session = true;
return (Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session));
}
$authSubUrl = getAuthSubUrl();
echo "<a href=\"$authSubUrl\">login to your Google account"</a>
Run Code Online (Sandbox Code Playgroud)
我不确定我在这里做错了什么.我几乎完全按照谷歌的例子.
他们确实有$next = getCurrentUrl();他们的例子,但是当我尝试时,我得到了未定义的错误.
php zend-framework google-calendar-api google-authentication zend-gdata
我想抓住用户的上传(即:BBC)并将输出限制为每页10个.
虽然我可以使用以下网址:http: //gdata.youtube.com/feeds/api/users/bbc/uploads/?start-index=1&max-results=10
以上工作没问题.
我想使用查询方法:
Zend Framework文档:http: //framework.zend.com/manual/en/zend.gdata.youtube.html
说明我可以检索用户上传的视频,但理想情况下我想使用查询方法来限制分页的结果.
查询方法在Zend框架文档上(与之前在"按元数据搜索视频"标题下的页面相同),与此类似:
$yt = new Zend_Gdata_YouTube();
$query = $yt->newVideoQuery();
$query->setTime('today');
$query->setMaxResults(10);
$videoFeed = $yt->getUserUploads( NULL, $query );
print '<ol>';
foreach($videoFeed as $video):
print '<li>' . $video->title . '</li>';
endforeach;
print '</ol>';
问题是我不能做$ query-> setUser('bbc').
我尝试了setAuthor,但这会返回一个完全不同的结果.
理想情况下,我想使用查询方法以分页方式获取结果.
如何使用$ query方法设置分页限制?
谢谢.
所以,这是获取youtube用户的公共播放列表的代码:
function getyoutubeplaylists($userName) {
$yt = connectyoutube();
$yt->setMajorProtocolVersion(2);
$playlistListFeed = $yt->getPlaylistListFeed($userName);
foreach ($playlistListFeed as $playlistListEntry) {
$playlist['title'] = $playlistListEntry->title->text;
$playlist['id'] = $playlistListEntry->getPlaylistID();
$playlists[] = $playlist;
$playlistVideoFeed = $yt->getPlaylistVideoFeed($playlistListEntry->getPlaylistVideoFeedUrl());
foreach ($playlistVideoFeed as $videoEntry) {
$playlist_assignment['youtube_id'] = substr($videoEntry->getVideoWatchPageUrl(),31,11);
$playlist_assignment['id'] = $playlist['id'];
$playlist_assignments[] = $playlist_assignment;
}
}
$everything['playlists'] = $playlists;
$everything['playlist_assignments'] = $playlist_assignments;
return $everything;
}
Run Code Online (Sandbox Code Playgroud)
问题是,这只会得到第一页或结果.关于如何使用Zend Gdata检索下一页结果的任何想法?
原始gdata XML显示了所需的URL:
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/users/pennstate/playlists?start-index=1&max-results=25"/>
<link rel="next" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/users/pennstate/playlists?start-index=26&max-results=25"/>
Run Code Online (Sandbox Code Playgroud)
但是,getPlaylistListFeed似乎没有任何参数来指定"start-index"或"max-results".
我正在尝试使用Zend Gdata 1.11库在Google Spreadsheet中插入行的最简单方案.电子表格在单元格A1中有单词'Kolona'.这是整个php文件:
<?php
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_loader::loadClass('Zend_Gdata_Query');
Zend_Loader::loadClass('Zend_Gdata_Spreadsheets');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$user = "xxxx";
$pass = "xxxx";
$service = 'wise';
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service, null, Zend_Gdata_ClientLogin::DEFAULT_SOURCE, null, null, Zend_Gdata_ClientLogin::CLIENTLOGIN_URI, 'GOOGLE');
$spreadsheetService = new Zend_Gdata_Spreadsheets($client);
$feed = $spreadsheetService->getSpreadsheetFeed();
foreach ($feed as $entry) {
echo 'Title: ' . $entry->title . ' - ';
echo 'Id: ' …Run Code Online (Sandbox Code Playgroud) 我正在关注使用gData Youtube API进行PHP直接上传的文档.我可以成功上传视频,所以这一切都很好.我正在弄清楚的部分,如果它甚至可能获得一些上传进度状态,如完成百分比或上传的字节数.
以下是上传发生的代码片段.
<?php
try {
$newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry');
} catch (Zend_Gdata_App_HttpException $httpException) {
echo $httpException->getRawResponseBody();
} catch (Zend_Gdata_App_Exception $e) {
echo $e->getMessage();
}
?>
Run Code Online (Sandbox Code Playgroud)
任何人有任何想法如何更新$progess变量或东西,因为这是上传?
我正在尝试通过Zend_GData库更新Google电子表格.我确定用户ID和密码是正确的.我认为问题在于电子表格密钥或工作表ID.即使我不知道如何获得这个workheetID.请帮助我.这是m工作表的确切URL.
这是我的代码.
$user = 'xxxxxxxxxxxxxxxxxxxxxx';
$pass = 'xxxxxxxxxxxxxxxxxx';
$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
$spreadsheetService = new Zend_Gdata_Spreadsheets($client);
$spreadsheetKey = "0AmW1-CVeX7oOdGRkYURWNXVMRi1DTW9NTGNhZ09OTGc";
$worksheetId = "Sheet1";
try
{
$spreadsheetService->insertRow(array('Prasad','10000'),$spreadsheetKey,$worksheetId);
}
catch(Exception $error)
{
echo $error->getMessage() ;
}
Run Code Online (Sandbox Code Playgroud)
这是我在浏览器屏幕上看到的错误消息.
预期的响应代码200,得到400无效的grid-id查询参数值.
zend-gdata ×10
php ×9
youtube-api ×3
youtube ×2
gdata-api ×1
google-api ×1
icalendar ×1
oauth ×1
progress ×1
sharepoint ×1
spreadsheet ×1
upload ×1