We need to create the ability to get comments for videos. I think both a function to get comments for an individual video (using either the video ID, or I believe a comment feed resource link may come back in the video object) as well as an optional flag to load comments for videos when hitting user feeds, doing searches, etc. would work best.

CommentFileSizeAuthor
#3 youtube_api_comments.patch4.43 KBbeeradb
#1 comments.patch8.88 KBbeeradb

Comments

beeradb’s picture

StatusFileSize
new8.88 KB

Implements comments by adding two different functions..

/**
 * Gets a list of video comments from the specified feed and returns them as comment objects.
 *
 * @param $feed
 *   The URL of the comment feed you want.
 * @param $start_at
 *   The record to start at.
 * @param $num_comments
 *   The number of comments to return.
 *
 */
$comments = youtube_api_get_comments($video->comments['href'], 1, 25);

/**
 * Parse the returns of a single comment entry from the XML feed and return it as an object.
 *
 * @param $entry
 *   The simpleXML object for a comments entry record.
 *
 */
$comment = youtube_api_get_comment_object($entry);

Probably still needs to include the ability to load comments along with videos from video searches, loading a video directly, user feeds, etc.

Thoughts?

beeradb’s picture

Status: Active » Needs work
beeradb’s picture

StatusFileSize
new4.43 KB

Now with a fresh theme function, and an optional parameter to theme_youtube_api_embed to load/display comments for a given video.

dmsundaram’s picture

Title: Comment Parsing » Where can I get batch for Youtupe api?

Hi,

Where can I get YouTupe API batch? Please guide me.

Thanks & Regards
Meenakshi Sundaram

NetLink Technologies, Chennai

beeradb’s picture

Title: Where can I get batch for Youtupe api? » Comment Parsing
Status: Needs work » Closed (fixed)

committed by CVS commit #123581

I've shelfed the idea of having loading comments be an optional parameter to the functions for video feeds, as making that many successive calls to the API is _slow_. May revisit later.