static void Main(string[] args) { IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner(); IUrl2UrlRunner p2 = new BlockedUrl2UrlRunner(); IUrl2UrlRunner p3 = new BlockedUrl2UrlRunner(); IUrl2UrlRunner p4 = new BlockedUrl2UrlRunner(); var urls = new FixedUrls(); urls.Urls.Add("https://tarheelants.com/collections"); p1.From(urls); p2.SetProcessor(new Main2Collects(4)); p1.To(p2); p3.SetProcessor(new Collect2Items(4)); p2.To(p3); p4.SetProcessor(new Item2Image(4)); p3.To(p4); var downloader = new XJpgDownloader(); downloader.SetSavePath(@"F:\ant\tarheelants\"); p4.To(downloader); p4.Start(); p3.Start(); p2.Start(); p1.Start(); Console.ReadKey(); }
private static void OnColor() { IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner(); IUrl2UrlRunner p2 = new BlockedUrl2UrlRunner(); IUrl2ResultRunner p3 = new AsyncUrl2ResultRunner(); var result = new List <UserColor>(); p1.From(new UserColorUrlGenerater(1, 132)); p1.To(p2); p2.To(p3); p2.SetProcessor(new UserColorUrl2Url(4)); p3.To(new UserColorResult(result)); p3.Start(); p2.Start(); p1.Start(); Console.ReadKey(); using (var fs = new FileStream("Color.json", FileMode.Create, FileAccess.ReadWrite)) { using (var writer = new StreamWriter(fs)) { writer.Write(JsonConvert.SerializeObject(result)); } } }
static void Main(string[] args) { IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner(); IUrl2ResultRunner p3 = new AsyncUrl2ResultRunner(); IUrlGenerater gen1 = new TestUrlGenerater(); IUrlGenerater gen2 = new TestUrlGenerater2(); IUrl2Result to1 = new TestUrl2Result(); IUrl2Result to2 = new TestUrl2Result2(); p1.From(gen1); p1.From(gen2); p1.To(to1); p1.To(p3); p3.To(to2); p3.Start(); p1.Start(); }
static void Main(string[] args) { IUrlGeneraterRunner p1 = new MultiUrlGeneraterRunner(); IUrl2UrlRunner p2 = new BlockedUrl2UrlRunner(); IUrl2ResultRunner p3 = new AsyncUrl2ResultRunner(); p1.From(new TestUrlGenerater()); p1.To(p2); p2.To(p3); p2.SetProcessor(new TestUrl2Url()); p3.To(new TestUrl2Result()); p3.Start(); p2.Start(); p1.Start(); }