获取总结果 Youtube Api PHP

发布于 2024-11-04 07:02:10 字数 351 浏览 7 评论 0原文

嘿,现在我正在解析 youtube 的 api

演示网址:

http://gdata.youtube.com/feeds/api/videos/-/test?orderby=viewCount&start-index=1&max-results=50

我正在使用 simplexml_load_file

,问题是,我应该做什么来检索

<openSearch:totalResults>9477</openSearch:totalResults>

任何想法?

谢谢

Hey, well right now I'm parsing youtube's api

demo url :

http://gdata.youtube.com/feeds/api/videos/-/test?orderby=viewCount&start-index=1&max-results=50

i'm using simplexml_load_file

the thing is, what should i do to retrieve the

<openSearch:totalResults>9477</openSearch:totalResults>

any ideas?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傾城如夢未必闌珊 2024-11-11 07:02:10
$feedURL = "http://gdata.youtube.com/feeds/api/videos?q=test&orderby=viewCount&start-index=1&max-results=1";
$sxml = simplexml_load_file($feedURL);
$counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');
$total = $counts->totalResults;
$feedURL = "http://gdata.youtube.com/feeds/api/videos?q=test&orderby=viewCount&start-index=1&max-results=1";
$sxml = simplexml_load_file($feedURL);
$counts = $sxml->children('http://a9.com/-/spec/opensearchrss/1.0/');
$total = $counts->totalResults;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文