展示新闻,音乐,体育节目。谢谢。
private void loadfeedYoutube()
{
string feedUrl="https://gdata.youtube.com/feeds/api/standardfeeds/most_popular";
var request=new
Feed<Video> videoFeed = request.Get<Video>(new Uri(feedUrl));
printVideoFeed(videoFeed);
static void printVideoFeed(Feed<Video> feed)
{
foreach (Video entry in feed.Entries)
{
printVideoEntry(entry);
}
}
}
我正在使用:
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using Google.Apis.Upload;
using Google.Apis.Util.Store;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
错误:找不到供稿,要求...
最佳答案
正在使用myToolkit
private void GetYoutubeChannel(string feedXML)
{
try
{
SyndicationFeed feed = new SyndicationFeed();
feed.Load(feedXML);
List<YoutubeVideo> videosList = new List<YoutubeVideo>();
YoutubeVideo video;
foreach (SyndicationItem item in feed.Items)
{
video = new YoutubeVideo();
video.YoutubeLink = item.Links[0].Uri;
string a = video.YoutubeLink.ToString().Remove(0, 31);
video.Id = a.Substring(0, 11);
video.Title = item.Title.Text;
video.PubDate = item.PublishedDate.DateTime;
video.Thumbnail = YouTube.GetThumbnailUri(video.Id, YouTubeThumbnailSize.Large);
videosList.Add(video);
}
MainListBox.ItemsSource = videosList;
}
catch { }
}
关于c# - 如何在Windows Store C#上加载FEEDS youtube apis v3,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25030215/