- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从youtube api中获取 View 数量,它对标题,URL和缩略图效果很好,尽管对 View 数量却不起作用。
这是我试图从中获取的XML代码(请看最后一行):
<feed xmlns:gml="http://www.opengis.net/gml" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:georss="http://www.georss.org/georss" xmlns:app="http://purl.org/atom/app#" xmlns:media="http://search.yahoo.com/mrss/" xmlns:gd="http://schemas.google.com/g/2005" xmlns="http://www.w3.org/2005/Atom">
<id>http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web</id>
<updated>2012-03-21T03:32:37.000-07:00</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
<title type="text">On the Web</title>
<logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web"/>
<link rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web/batch"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web?start-index=1&max-results=25"/>
<link rel="next" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web?start-index=26&max-results=25"/>
<author>
<name>YouTube</name>
<uri>http://www.youtube.com/</uri>
</author>
<generator version="2.1" uri="http://gdata.youtube.com">YouTube data API</generator>
<openSearch:totalResults>192</openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>25</openSearch:itemsPerPage>
<entry>
<id>http://gdata.youtube.com/feeds/api/videos/LSNxrEa3Usw</id>
<published>2012-03-07T01:09:29.000Z</published>
<updated>2012-03-21T10:32:34.000Z</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video"/>
<category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Entertainment" label="Entertainment"/>
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="makena"/>
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="adele"/>
<category scheme="http://gdata.youtube.com/schemas/2007/keywords.cat" term="singing"/>
<title type="text">2yr old Makena sings Adele...so cute</title>
<content type="text">My 2yr old daughter loves Adele and sings along!</content>
<link rel="alternate" type="text/html" href="http://www.youtube.com/watch?v=LSNxrEa3Usw&feature=youtube_gdata"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/LSNxrEa3Usw/responses"/>
<link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos/LSNxrEa3Usw/related"/>
<link rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html" href="http://m.youtube.com/details?v=LSNxrEa3Usw"/>
<link rel="self" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/standardfeeds/on_the_web/v/LSNxrEa3Usw"/>
<author>
<name>heatherfedorick</name>
<uri>http://gdata.youtube.com/feeds/api/users/heatherfedorick</uri>
</author>
<gd:comments>
<gd:feedLink rel="http://gdata.youtube.com/schemas/2007#comments" href="http://gdata.youtube.com/feeds/api/videos/LSNxrEa3Usw/comments" countHint="2433"/>
</gd:comments>
<yt:hd/>
<media:group>
<media:category label="Entertainment" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Entertainment</media:category>
<media:content url="http://www.youtube.com/v/LSNxrEa3Usw?version=3&f=standard&app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isDefault="true" expression="full" duration="105" yt:format="5"/>
<media:content url="rtsp://v5.cache6.c.youtube.com/CiQLENy73wIaGwnMUrdGrHEjLRMYDSANFEgGUghzdGFuZGFyZAw=/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="105" yt:format="1"/>
<media:content url="rtsp://v5.cache6.c.youtube.com/CiQLENy73wIaGwnMUrdGrHEjLRMYESARFEgGUghzdGFuZGFyZAw=/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="105" yt:format="6"/>
<media:description type="plain">My 2yr old daughter loves Adele and sings along!</media:description>
<media:keywords>makena, adele, singing</media:keywords>
<media:player url="http://www.youtube.com/watch?v=LSNxrEa3Usw&feature=youtube_gdata_player"/>
<media:restriction type="country" relationship="deny">DE</media:restriction>
<media:thumbnail url="http://i.ytimg.com/vi/LSNxrEa3Usw/0.jpg" height="360" width="480" time="00:00:52.500"/>
<media:thumbnail url="http://i.ytimg.com/vi/LSNxrEa3Usw/1.jpg" height="90" width="120" time="00:00:26.250"/>
<media:thumbnail url="http://i.ytimg.com/vi/LSNxrEa3Usw/2.jpg" height="90" width="120" time="00:00:52.500"/>
<media:thumbnail url="http://i.ytimg.com/vi/LSNxrEa3Usw/3.jpg" height="90" width="120" time="00:01:18.750"/>
<media:title type="plain">2yr old Makena sings Adele...so cute</media:title>
<yt:duration seconds="105"/>
</media:group>
<gd:rating average="4.9061623" max="5" min="1" numRaters="18159" rel="http://schemas.google.com/g/2005#overall"/>
<yt:statistics favoriteCount="3144" viewCount="3134579"/>
</entry>
<?xml version="1.0" ?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://www.w3.org/2005/Atom"
xmlns:media='http://search.yahoo.com/mrss/'>
xmlns:yt='http://gdata.youtube.com/schemas/2007'
<xsl:template match="/">
<xsl:for-each select="/a:feed/a:entry">
<item>
<xsl:attribute name="type">youtube</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="a:title" />
</xsl:attribute>
<xsl:attribute name="author">
<xsl:value-of select="a:author/a:name" />
</xsl:attribute>
<xsl:attribute name="url">
<xsl:value-of select="a:link/@href" />
</xsl:attribute>
<xsl:attribute name="image">
<xsl:value-of select="media:group/media:thumbnail[@width='120']/@url" />
</xsl:attribute>
<xsl:attribute name="score">
<xsl:value-of select="yt:statistics/@viewCount" />
</xsl:attribute>
</item>
</xsl:for-each>
</xsl:template>
<xsl:attribute name="score">
<xsl:value-of select="yt:statistics/@viewCount" />
</xsl:attribute>
最佳答案
您作为样式表发布的内容格式不正确,尤其是其中带有前缀yt
的 namespace 声明
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://www.w3.org/2005/Atom"
xmlns:media='http://search.yahoo.com/mrss/'>
xmlns:yt='http://gdata.youtube.com/schemas/2007'
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="http://www.w3.org/2005/Atom"
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:yt='http://gdata.youtube.com/schemas/2007'>
关于xml - 从youtube api XSLT中获取观看次数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9803012/
是否有任何解决方案来禁用右键单击选项并从 Youtube 视频中删除右下角水印 Logo ?我在搜索 GOOGLE 后尝试过。谁能告诉我? 谢谢你。 最佳答案 试试 modestbranding范围:
我想使用 YouTube API (v3) 来启用仅音乐轨道的搜索(没有猫或藤蔓或任何其他非音乐视频)。我查看了 API Explorer 和文档以获取有关该问题的任何指示,但找不到任何有用的信息。
我需要为网站使用YouTube视频缩略图的maxresdefault版本,但是在开发实现此目的的代码后,我发现并非所有视频都具有这些缩略图,尽管这些视频均为1080p。 有没有一种方法可以自动为我的所
我想通过“iframe”嵌入youtube视频,但YouTube在我国禁止使用,建议我如何在我的网站上嵌入视频! [1]:以下图片显示了在我的国家/地区无法访问youtube 最佳答案 该视频将被嵌入
我正在为myBB使用一个名为Profile Music Plugin的插件,可以在此处找到http://community.mybb.com/mods.php?action=view&pid=75 我
Youtube IFRAME API中是否有可以执行命令的功能,例如在播放的视频结尾处打开网站? (我相信有一个功能可以在旧的Java API下执行此操作,但该功能已于去年弃用。) 最佳答案 您可以引
我试图在Videos.insert和Videos.update查询中设置3d尺寸标志。但是标志不会改变。 更新查询示例: 请求: PUT https://www.googleapis.com/yout
使用此获取评论 评论主题:列表 GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet { "error": {
最近,我尝试使用OEmbed服务通过播放列表查询参数获取视频网址的iframe代码,但是OEmbed为我们提供了与我要求的视频不同的iframe代码。 这是带有播放列表查询参数的视频网址: https
我正在使用此代码: https://www.googleapis.com/youtube/v3/search?q=global+warming&part=id&maxResults=50&key=MY
我有一个LiveBroadcast,并且将来会添加一个scheduledStartTime。据我所知,这次测试不会对LiveBroadcast的整体状态产生影响,即广播是否具有准备就绪/测试的life
YouTube API是否支持在特定时间后关闭浏览器的参数? 这需要使用链接在不同位置共享来推广促销视频。视频播放结束后关闭浏览器。 最佳答案 您可以使用Youtube API监控视频是否播放完毕,然
如果没有表单上的透明面板,YouTube Player将可以正常播放视频,或者可以全屏播放视频,透明面板中有一些图像没有什么特别的。如果我取出透明面板,则YouTube播放器会按需工作,并嵌入到应用程
我正在通过Google进行身份验证,以尝试获取YouTube分析数据,但我的问题是我不知道在查询YouTube时如何向您填充参数 在这里,我正在提供一项新服务:然后尝试查询它 我不确定要在“ids”参
我想添加youtube视频列表,但不添加视频播放器。所以我需要的是 视频标题 视频缩略图 视频时长 我以某种方式设法通过使用此http://img.youtube.com/vi/4wew2uWoARw
我正在使用youtube api和python库gdata 我遵循了文档,但似乎没有出路。 问题是 - How do i get the size of the youtube video fil
使用Youtube API,我如何获得评论或顶过youtube视频的用户ID /处理列表? 提前致谢 最佳答案 在这里,您可以了解如何使用YouTube API v2(v3尚不支持此注释)获取评论:h
我正在为所有相关数据构建一个仪表板(以php为单位),我还想在YouTube“稍后观看”播放列表中显示我的商品数量。 我知道无法使用YouTube API来解决这个问题,但是也许有人想出一种解决方法?
我尝试使用YouTube API,但存在引号问题。 SearchResource.ListRequest searchListRequest = yt.Search.List("sni
我想为我的Android应用程序的用户构建视频推荐器。我有Google OAuth可以登录我的应用程序。我可以获取有关我的应用程序用户在YouTube上观看的视频的数据吗? 最佳答案 v3 API分为
我是一名优秀的程序员,十分优秀!