v2 API shutdown

45 views
Skip to first unread message

Elfab Limited

unread,
Apr 7, 2015, 11:30:44 AM4/7/15
to gdata-dotnet-...@googlegroups.com
Hi folks

I understand the v2 API is being shutdown and want to update this code
       public YoutubeVideo[] YoutubeVideos()
        {
            string YOUTUBE_CHANNEL = ConfigurationManager.AppSettings["YoutubeChannel"];
            string YOUTUBE_DEVELOPER_KEY = ConfigurationManager.AppSettings["YoutubeDeveloperKey"];

            Google.YouTube.YouTubeRequestSettings settings = new Google.YouTube.YouTubeRequestSettings(YOUTUBE_CHANNEL, YOUTUBE_DEVELOPER_KEY);
            Google.YouTube.YouTubeRequest request = new Google.YouTube.YouTubeRequest(settings);
            //TODO:  ORDERBY NEEDS TO BE REPLACED WITH ORDER, URL needs updating?
            string feedUrl = String.Format("https://gdata.youtube.com/feeds/api/users/{0}/uploads?orderby=published", YOUTUBE_CHANNEL);
            
            Google.GData.Client.Feed<Google.YouTube.Video> videoFeed = request.Get<Google.YouTube.Video>(new Uri(feedUrl));

            return (from video in videoFeed.Entries
                    select new YoutubeVideo()
                    {
                        VideoId = video.VideoId,
                        Title = video.Title,
                        Description = video.Description,
                        Uploaded = Convert.ToString(video.Updated.ToShortDateString())
                    }).ToArray();
        }

I knwo the URL and search parameter will need updating but what to?  (Apols if this is a duplicate, cannot seem to see it!)
Reply all
Reply to author
Forward
0 new messages