Youtube RSS 提要显示最受欢迎的视频? [英] Youtube rss feed to show most popular video?
问题描述
我有两个 youtube rss 提要,但我希望最受欢迎的提要在顶部显示观看次数最多的视频,我该怎么做?
I have two youtube rss feeds but I want the most popular feed to show the most viewed video at the top, how can I do this?
http://www.youtube.com/rss/tag/channelname.rsshttp://gdata.youtube.com/feeds/api/users/channelname/uploads
http://www.youtube.com/rss/tag/channelname.rss http://gdata.youtube.com/feeds/api/users/channelname/uploads
推荐答案
您想要的提要是:
http://gdata.youtube.com/feeds/api/users/channel/uploads?alt=rss&v=2&orderby=viewCount
这将为您提供按观看次数排序的频道的 YouTube 视频.如果你想要超过默认的 25,你可以添加 &max-results=50
.(我也倾向于添加 prettyprint=true
和 strict=true
在我测试时)
This will give you a channel's youtube videos sorted by view count. You can add &max-results=50
if you want more than the default 25. (Also I tend to add prettyprint=true
and strict=true
when I'm testing)
http://www.youtube.com/rss/tag/channelname.rss 实际上重定向到 http://gdata.youtube.com/feeds/base/videos/-/channelname?orderby=published&alt=rss&client=ytapi-youtube-rss-redirect&v=2 暂时可能有效,但 Google 建议人们远离/feeds/base/提要.这也有点不幸(以懒惰的方式),因为这个带有 client=ytapi...
的 /feeds/base/
提要为每个条目提供了一个很好的可渲染 HTML 块.
http://www.youtube.com/rss/tag/channelname.rss actually redirects to http://gdata.youtube.com/feeds/base/videos/-/channelname?orderby=published&alt=rss&client=ytapi-youtube-rss-redirect&v=2 which may work for the time being but Google has suggested people move away from the /feeds/base/ feeds. It's slightly unfortunate too (In the lazy way) because this /feeds/base/
feed with client=ytapi...
gives you a nice renderable block of HTML for each entry.
这篇关于Youtube RSS 提要显示最受欢迎的视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!