Ramco Ramco

Ramco Ramco

  • 436
  • 3.4k
  • 546.4k

List of own Youtube Videos.

Aug 22 2024 4:40 AM

 I am trying like below but in all Items it is showing count = 0. I have deliberately written htps since it does not allow me to Post.


StringBuilder htmlTable = new StringBuilder();

var client = new RestClient("googleapis.com/youtube/v3");
var request = new RestRequest("search", Method.GET);
request.AddParameter("part", "snippet");

request.AddParameter("type", "video");
request.AddParameter("channelId", "UCg3Zp-m_nNVw");
request.AddParameter("key", "AIzaSu9f5blG8");

List<YoutubeSearchItem> allItems = new List<YoutubeSearchItem>();

// Make initial request for youtube endpoint
IRestResponse<YoutubeSearchListResponse> response = client.Execute<YoutubeSearchListResponse>(request);


htmlTable.Append("<table class='table table-bordered table-hover datatable-highlight' id='tbldata'>");
htmlTable.Append("<thead><tr><th>Video Id</th><th>Video Title</th><th>Description</th><th>Views</th><th>Like</th><th>Comment</th><th>Published</th></tr></thead>");
htmlTable.Append("<tbody>");

foreach (var data in allItems.OrderBy(x => x.snippet.publishedAt))
Thanks

 


Answers (1)