YouTube评论阅读器,可阅读YouTube视频的所有评论 [英] YouTube Comment Reader to read all the comments of a youtube video
本文介绍了YouTube评论阅读器,可阅读YouTube视频的所有评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写代码来阅读youtube视频上的所有评论。我的代码只读了前25条评论。我需要帮助来阅读YouTube视频中的所有评论!! (ASP .NET-C#)
这是我的代码只读前25条评论:
I am writing a code to read all the comments on a youtube video. My code just read the first 25 comments. I need help to read all the comments from a youtube video!! (ASP .NET-C#)
Here is my code that read only first 25 comments:
appName = "testApp";
settings = new YouTubeRequestSettings(appName, devKey);
request = new YouTubeRequest(settings);
videoEntryUri = new Uri("http://gdata.youtube.com/feeds/api/videos?q=22O5QnSLdeE");
vid= request.Retrieve<Video>(videoEntryUri);
comments = request.GetComments(vid);
Response.Write(vid.ResponseUri);
Response.Write("Total Number of comment on the video:"+vid.CommmentCount);
Response.Write("<br>Total number of comment getting throug feed: " + comments.TotalResults);
int counter = 1;
//<gd:feedLink href='http://gdata.youtube.com/feeds/api/videos/8aYQ_wjmxiQ/comments' countHint='0'
Response.Write("<table width='450' border='1'>");
foreach ( Comment c in comments.Entries)
{
Response.Write("<tr><td>" + c.Author + "</td><td>" + c.Updated.Date + "</td></tr>");
Response.Write("<tr><td colspan='2'>"+c.Content+"</td></tr>");
counter++;
}
Response.Write("</table>");
Response.Write("Total Number of Comment Display: "+counter);
}
}
推荐答案
如何设置Settings.Maximum
更大的数字!?
试试吧。
或者使用start-index
ini * 25 + 1
从i = 0
到countHint在Feed中找到
(此处为361)。
How about settingSettings.Maximum
to a larger number!?
Try it.
Or iterate usingstart-index
ini*25 + 1
fromi=0
upto thecountHint
found in feed (here 361).
这篇关于YouTube评论阅读器,可阅读YouTube视频的所有评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文