【发布时间】:2012-11-05 22:42:48
【问题描述】:
我正在使用以下代码将最近的 youtube cmets 检索到视频:
<?php
$videoId='lWA2pjMjpBs';
$url="http://gdata.youtube.com/feeds/api/videos/{$videoId}/comments";
$comments=simplexml_load_file($url);
foreach($comments->entry as $comment)
{
echo '<fieldset>'.$comment->content.'</fieldset>';
}
?>
我有两个问题: 1) 有没有办法限制 cmets 的数量,所以我只能显示示例 10 cmets? 2) 是否可以排除被标记为垃圾邮件的 cmets?
谢谢。
【问题讨论】:
标签: php api youtube youtube-api