0
林檢索最近的YouTube評論視頻:的Youtube API的評論限制使用下面的代碼
<?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>';
}
?>
和我有2個問題: 1)有沒有什麼辦法來限制評論數,這樣我就可以顯示只有10個評論的例子? 2)是否可以排除標記爲垃圾郵件的評論?
謝謝。
經過測試和工作,謝謝。 –
不客氣,如果足夠了,請將它設置爲已接受的答案。 –