public static YoutubeComment TextFormat(this YoutubeComment comment, TextFormat f) { var settings = comment.Settings.Clone(); settings.TextFormat = f; return(Comment(settings)); }
public static YoutubeChannel AuthorChannel(this YoutubeComment comment) { if (comment.AuthorChannelId == null) { return(null); } return(Channel(comment.AuthorChannelId)); }
public static YoutubeVideo Video(this YoutubeComment comment) { if (comment.VideoId == null) { return(null); } return(Video(comment.VideoId)); }
public static YoutubeComment Parent(this YoutubeComment comment) { if (comment.ParentId != null) { return(Comment(comment.ParentId)); } return(null); }
private AverageSentiment ParseCommentThreadListResponse(CommentThreadListResponse commentThreadListResponse) { // Construct the empty parsed comment threads list AverageSentiment averageScore = new AverageSentiment(); // Iterate over the comment thread list response and add each comment text foreach (CommentThread commentThread in commentThreadListResponse.Items) { var comment = new YoutubeComment(); comment.AuthorName = commentThread.Snippet.TopLevelComment.Snippet.AuthorDisplayName; comment.Content = commentThread.Snippet.TopLevelComment.Snippet.TextDisplay; comment.SentimentScore = SentimentAnalysis.SelectComments(comment.Content); averageScore.CommentList.Add(comment); } // Set the average sentiment score averageScore.AverageSentimentScore = averageScore.CommentList.Average(c => c.SentimentScore); averageScore.VideoURL = commentThreadListResponse.Items[0].Snippet.VideoId; averageScore.AnalysisDate = DateTime.Now; // Return the parsed comment threads list return(averageScore); }
public static YoutubeComments Replies(this YoutubeComment comment) { return(Comments().ForParentId(comment.Id)); }
public static YoutubeComment FormatPlainText(this YoutubeComment comment) { return(comment.TextFormat(Enums.TextFormat.PlainText)); }
public static YoutubeComment FormatHtml(this YoutubeComment comment) { return(comment.TextFormat(Enums.TextFormat.Html)); }
public static YoutubeCommentThread CommentThread(this YoutubeComment comment) { return(CommentThread(comment.Id.Split('.')[0])); }