Exemplo n.º 1
0
        public static IList <IRegexableWebsite> ParseWebsite <T, U, V>(string rootURLText, Action <string> report)
            where T : IRegexableWebsite, new()
            where U : IRegexableWebsite, new()
            where V : IRegexableWebsite, new()
        {
            var initialScreenscrape = new WebScreenScrape <T>(rootURLText);

            initialScreenscrape.PopulateData();
            var secondScreenScrape = new WebScreenScrape <U>(rootURLText);

            secondScreenScrape.PopulateData();
            var thirdScreenScrape = new WebScreenScrape <V>(rootURLText);

            thirdScreenScrape.PopulateData();

            var allRegexables = new List <IRegexableWebsite>();

            allRegexables.AddRange(initialScreenscrape.SiteData.Cast <IRegexableWebsite>());
            allRegexables.AddRange(secondScreenScrape.SiteData.Cast <IRegexableWebsite>());
            allRegexables.AddRange(thirdScreenScrape.SiteData.Cast <IRegexableWebsite>());

            allRegexables.ForEach(a => a.Clean());

            return(allRegexables
                   .OrderBy(r => r.Identifier)
                   .ToList());
        }
Exemplo n.º 2
0
        public static IList <IRegexableWebsite> ParseWebsite <T>(Uri rootURI, Action <string> report, CookieContainer cookies = null)
            where T : IRegexableWebsite, new()
        {
            var initialScreenscrape = new WebScreenScrape <T>(rootURI);

            initialScreenscrape.PopulateData(cookies);

            var allRegexables = new List <IRegexableWebsite>();

            allRegexables.AddRange(initialScreenscrape.SiteData.Cast <IRegexableWebsite>());

            allRegexables.ForEach(a => a.Clean());

            return(allRegexables
                   .OrderBy(r => r.Identifier)
                   .ToList());
        }