- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在Youtube API的2.0版中(已停产),API文档规定了如何制定复合/词组搜索的逻辑,API v3.0的等效信息是什么?
我需要怎么做才能将关键字转换为可以在API v3.0上使用?
以下是v2.0的文字:
The q parameter specifies a search query term. YouTube will search allvideo metadata for videos matching the term. Video metadata includestitles, keywords, descriptions, authors' usernames, and categories.Note that any spaces, quotes or other punctuation in the parametervalue must be URL-escaped.
To search for an exact phrase, enclose thephrase in quotation marks. For example, to search for videos matchingthe phrase "spy plane", set the q parameter to %22spy+plane%22. Yourrequest can also use the Boolean NOT (-) and OR (|) operators toexclude videos or to find videos that are associated with one ofseveral search terms. For example, to search for videos matchingeither "boating" or "sailing", set the q parameter toboating|sailing. (Note that the pipe character must be URL-escaped.)Similarly, to search for videos matching either "boating" or "sailing"but not "fishing", set the q parameter to boating|sailing+-fishing.
最佳答案
您可以测试此api过滤器是否相同:此处是youtube和Wikipedia的示例。如您在浏览器调试器上可以显示的,所有参数都通过管道“|”发送到参数“q” ...
window.searchModule = {
cors: "http://crossorigin.me/",
wikiEndpoint: "https://en.wikipedia.org/w/api.php",
ytEndpoint: "https://www.googleapis.com/youtube/v3/search",
ytKey: "AIzaSyDsPK3Cs1A4ipMjNr147ubG5HpoDyW6zzk",
init: function(sentSearch) {
var self = this,
bandCheck = $("#bandCheckbox").is(":checked");
if(bandCheck == true) {
sentSearch = sentSearch + "+(band)";
}
self.wikiSearch(sentSearch);
self.ytSearch(sentSearch);
self.watchers();
},
wikiSearch: function(sentSearch) {
var self = this;
$.ajax({
url: self.cors + self.wikiEndpoint + "?action=query&list=search&srsearch=" + sentSearch + "&srlimit=1&format=json",
success: function(response) {
//console.log(response.query);
self.formatWiki(response.query);
},
error: function(response) {
console.log(response);
}
})
} .....
关于api - 在Youtube API中进行词组搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46636066/
我想用 Java 编写一个正则表达式来匹配一个单词字符和空格序列,然后是一个单词字符和空格序列的“子类”字符序列: 应该匹配的示例字符串: a subclass of b a and b subcla
考虑到我们有以下输入数据表。 import pandas as pd #Pandas settings to see all the data when printing pd.set_option(
我们如何在同义词集中找到单词短语?特别是,将此同义词集用于形容词“booked”: booked, engaged, set-aside -- (reserved in advance) 我用的是Ri
我是一名优秀的程序员,十分优秀!