我将基于浏览器上传的示例YouTube api代码复制并粘贴到我的网站,但是当我将类别更改为"游戏"时,它会显示错误的请求错误.
这是示例代码:
$myVideoEntry = new Zend_Gdata_YouTube_VideoEntry();
$myVideoEntry->setVideoTitle('My Test Movie');
$myVideoEntry->setVideoDescription('My Test Movie');
// The category must be a valid YouTube category!
$myVideoEntry->setVideoCategory('Autos');
// Set keywords. Please note that this must be a comma-separated string
// and that individual keywords cannot contain whitespace
$myVideoEntry->SetVideoTags('cars, funny');
$tokenHandlerUrl = 'http://gdata.youtube.com/action/GetUploadToken';
$tokenArray = $yt->getFormUploadToken($myVideoEntry, $tokenHandlerUrl);
$tokenValue = $tokenArray['token'];
$postUrl = $tokenArray['url'];
Run Code Online (Sandbox Code Playgroud)
但是,当我改变
$myVideoEntry->setVideoCategory('Autos');
Run Code Online (Sandbox Code Playgroud)
至
$myVideoEntry->setVideoCategory('Gaming');
Run Code Online (Sandbox Code Playgroud)
我明白了..
Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Expected response code 200, got 400 <?xml version='1.0' encoding='UTF-8'?><errors><error><domain>yt:validation</domain><code>invalid_value</code><location type='xpath'>media:group/media:category[@scheme='http://gdata.youtube.com/schemas/2007/categories.cat']/text()</location></error></errors> …Run Code Online (Sandbox Code Playgroud) 我想获取GDataXMLElement的字符串表示形式,包括标记,属性和子元素.例如,
NSLog(@"%@", [e description]);
将给出以下输出
GDataXMLElement 0x5f26720: {type:1 name:to xml:"<to>Tove</to>"}
Run Code Online (Sandbox Code Playgroud)
但我想得到
<to>Tove</to>
Run Code Online (Sandbox Code Playgroud)
我知道我可以用一些代码格式化字符串,但是有更好的方法吗?
我有一个视频ID.然后我通过YouTube Player API的IFrame API显示视频.视频显示,现在我需要立即获得此视频的标题.
请注意,当我通过YouTube播放器IFrame API显示YouTube视频时,我需要立即获得视频标题.
什么是最快的获得视频标题的方式?我需要解决方案.
谢谢.
我试图通过搜索获得YouTube视频的持续时间
var request = gapi.client.youtube.search.list({
q: q,
type : "video",
maxResults : 10,
part: 'snippet,contentDetails'
});
Run Code Online (Sandbox Code Playgroud)
作为一个额外的部分参数,我添加了contentDetails以获得持续时间,你可以在他们的文档中看到. https://developers.google.com/youtube/v3/getting-started
现在是愚蠢的部分.我得到的回应如下:
[
{
"error": {
"code": -32602,
"message": "contentDetails",
"data": [
{
"domain": "youtube.part",
"reason": "unknownPart",
"message": "contentDetails",
"locationType": "parameter",
"location": "part"
}
]
},
"id": "gapiRpc"
}
]
Run Code Online (Sandbox Code Playgroud)
"因此,part参数要求您选择应用程序实际使用的资源组件"那就是我做了什么,现在他们不再知道自己的参数了?
所以我想知道如何检索持续时间顺序contentDetails一般?最好的菲尔
我正在尝试使用gdata中的read.xls将Excel文件直接导入R.我在运行64位R的Windows机器上运行.
我已经检查了perl的PATH变量,我似乎已正确设置,所以这似乎不是问题.这是我的代码,我在下面附上了我的错误.有没有人对如何完成这项工作有任何指示?
require(RCurl)
require(gdata)
url <- "https://dl.dropboxusercontent.com/u/27644144/NADAC%2020140101.xls"
test <- read.xls(url)
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method, :
Intermediate file 'C:\Users\Me\AppData\Local\Temp\RtmpeoJNxP\file338c26156d7.csv' missing!
In addition: Warning message:
running command '"C:\STRAWB~1\perl\bin\perl.exe" "C:/Users/Me/Documents/R/win-library/3.0/gdata/perl/xls2csv.pl" "https://dl.dropboxusercontent.com/u/27644144/NADAC%2020140101.xls" "C:\Users\Me\AppData\Local\Temp\RtmpeoJNxP\file338c26156d7.csv" "1"' had status 22
Error in file.exists(tfn) : invalid 'file' argument
Run Code Online (Sandbox Code Playgroud) 目前我正在开发项目,我需要使用API访问Google Calenadar数据 - 一切正常但我无法获得事件开始时间/结束时间 - 最重要的信息.
我正在使用Zend框架和Zend_Gdata库,遗憾的是zend的文档并不详细
如何获得所需的事件数据?或者我应该使用另一个图书馆?
这是我获取事件Feed的功能:
public function getEvents($future_only = TRUE,$force_refresh = FALSE) {
if (($this->events != NULL) && $force_refresh == FALSE) {
return $this->events;
} else {
if ($this->getService() != NULL) {
$service = $this->getService();
try {
$query = $service->newEventQuery($this->url);
$query->setUser(null);
$query->setProjection(null);
$query->setVisibility(null);
$query->setOrderby('starttime');
if ($future_only) {
$query->setFutureevents('true');
} else {
$query->setFutureevents('false');
}
$event_feed = $service->getCalendarEventFeed($query);
$this->events = $event_feed;
return $event_feed;
} catch (Exception $exc) {
.
.
.
return NULL;
}
} else {
return …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用zend gdata来获取电子表格的工作表.我可以使用工作表列表
$query = new Zend_Gdata_Spreadsheets_DocumentQuery();
$query->setSpreadsheetKey($key);
$feed = $spreadSheetService->getWorksheetFeed($query);
Run Code Online (Sandbox Code Playgroud)
我想知道如何获得worksheetId.
我感谢任何帮助.
我想重命名整个包,它包括包名和导入的所有ocncence,在eclipse中更改.
例如com.google.gdata.client及其com.xyz.google.gdata.client的类及其所有出现的类.
实际上,我想根据我的要求自定义gdata-core.1.47.jar源代码.我需要做的第一件事是根据我的要求更改包结构.但是,当我按照上述步骤进行操作时,会自动添加更多导入
例如,在refctor之前,对于com.google.api.gbase.client类具有以下导入
import com.google.gdata.util.common.xml.XmlWriter;
import com.google.gdata.data.Extension;
import com.google.gdata.data.ExtensionProfile;
import com.google.gdata.data.AttributeHelper;
import com.google.gdata.data.ExtensionDescription;
import com.google.gdata.util.ParseException;
import com.google.gdata.util.XmlParser;
Run Code Online (Sandbox Code Playgroud)
但是在将它重命名为com.google.gdata.client到com.xyz.google.gdata.client之后,它会添加更多导入,如下所示,
import com.google.api.gbase.client.AddValueHandler;
import com.google.api.gbase.client.AttributeHistogram;
import com.google.api.gbase.client.GoogleBaseAttributeId;
import com.google.api.gbase.client.GoogleBaseAttributeType;
import com.google.api.gbase.client.GoogleBaseEntry;
import com.google.api.gbase.client.UniqueValue;
import com.google.gdata.util.XmlWriter;
import com.xyz.google.gdata.data.AttributeHelper;
import com.xyz.google.gdata.data.Extension;
import com.xyz.google.gdata.data.ExtensionDescription;
import com.xyz.google.gdata.data.ExtensionProfile;
import com.xyz.google.gdata.util.ParseException;
import com.xyz.google.gdata.util.XmlParser;
Run Code Online (Sandbox Code Playgroud) 很长一段时间以来,我一直在寻找答案.我在这里查看了其他问题,但找不到与我的情况相关的问题.谷歌搜索这个问题也没有用.
基本上,我使用ZF1的Gdata类来访问照片api.这是几个星期前工作但停止工作(我不确定是否有代码更改或谷歌完全停止了API).
我的代码如下:
private function _loadZendLibraries()
{
set_include_path(APP.'vendors');
require_once('Zend/Loader.php');
$Zend_Loader = new Zend_Loader();
$Zend_Loader->loadClass('Zend_Gdata');
$Zend_Loader->loadClass('Zend_Gdata_ClientLogin');
$Zend_Loader->loadClass('Zend_Gdata_AuthSub');
$Zend_Loader->loadClass('Zend_Gdata_Photos');
$Zend_Loader->loadClass('Zend_Gdata_Photos_UserQuery');
$Zend_Loader->loadClass('Zend_Gdata_Photos_AlbumQuery');
$Zend_Loader->loadClass('Zend_Gdata_Photos_PhotoQuery');
$Zend_Loader->loadClass('Zend_Gdata_App_Extension_Category');
}
function checkGoogleImages(){
$this->_loadZendLibraries();
$service_name = Zend_Gdata_Photos::AUTH_SERVICE_NAME;
$user = '********@gmail.com';
$pass = '********';
try {
$this->client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service_name);
} catch (Zend_Gdata_App_Exception $e) {
$this->Session->setFlash("Error: " . $e->getMessage(). "<br /> You need go to Google+ => Settings => Applications and APPROVE the application to connect.", 'flash_failure');
$this->Session->delete('GOOGLE_USER');
$this->redirect($this->referer());
}
print "<pre>";
print_r($this->client);
exit;
}
Run Code Online (Sandbox Code Playgroud)
在一台服务器上它给出:
注意(8):未定义的偏移量:1 [APP/vendors/Zend/Gdata/ClientLogin.php,第150行]
另一方面: …
gdata ×9
php ×4
gdata-api ×3
youtube-api ×3
zend-gdata ×2
cakephp ×1
calendar ×1
cocoa-touch ×1
eclipse ×1
google-plus ×1
ios ×1
java ×1
javascript ×1
objective-c ×1
r ×1
video ×1
xml ×1
youtube ×1