开发者

Youtube rss feed to show most popular video?

开发者 https://www.devze.com 2023-01-25 19:00 出处:网络
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?

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.yout开发者_开发百科ube.com/rss/tag/channelname.rss http://gdata.youtube.com/feeds/api/users/channelname/uploads


The feed you want is:

http://gdata.youtube.com/feeds/api/users/channel/uploads?alt=rss&v=2&orderby=viewCount

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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号