I\'m using the YouTube API to get comments for a video with a parameterized query like the following:
http://gdata.youtube.com/feeds/api/videos/theVideoID/comm
I just came across this question and I notice that its been quite some time when this was asked. But since nobody answered it yet, I think I should do that.
What you should ideally do is, use Youtube's PHP API (using Zend_GData) and use the following code in PHP:
setMajorProtocolVersion(2);
$video = parse_url("http://www.youtube.com/watch?v=K-ob8sr9ZX0");
parse_str(urldecode($video['query']), $query);
$videoId = $query['v'];
$commentFeed = $yt->retrieveAllEntriesForFeed($yt->getVideoCommentFeed($videoId));
foreach ($commentFeed as $commentEntry) {
echo "Full text: " . $commentEntry->content->text . "
";
}
The key element here is the retrieveAllEntriesForFeed() method.
Instead of echo-ing all the comments, you can construct a JSON and send it back to the waiting Javascript.
It does not use the max-results or start-index, but does the job well without them.