private static void FindYoutubes() { Console.WriteLine("Find Youtubes"); var nextProduct = d.GetProductWithOutYoutube().FirstOrDefault(); if (nextProduct == null) { return; } var yt = new YouTube(d); while (nextProduct != null) { var currentProduct = d.Products.Where(t => t.SiteProductId == nextProduct.SiteProductId).FirstOrDefault(); if (currentProduct == null) { continue; } var searchURL = "http://www.youtube.com/results?search_query=" + currentProduct.ProductFullName.Replace("&", "%26"); yt.GetDescriptions(currentProduct, searchURL); nextProduct = d.GetProductWithOutYoutube().FirstOrDefault(); Thread.Sleep(3000); } }
private static void FindYoutubes() { Console.WriteLine("Find Youtubes"); var nextProduct = d.GetProductWithOutYoutube().FirstOrDefault(); if (nextProduct == null) return; var yt = new YouTube(d); while (nextProduct != null) { var currentProduct = d.Products.Where(t => t.SiteProductId == nextProduct.SiteProductId).FirstOrDefault(); if (currentProduct == null) continue; var searchURL = "http://www.youtube.com/results?search_query=" + currentProduct.ProductFullName.Replace("&", "%26"); yt.GetDescriptions(currentProduct, searchURL); nextProduct = d.GetProductWithOutYoutube().FirstOrDefault(); Thread.Sleep(3000); } }