예제 #1
0
 public SitemapLoader(ISitemapFetcher fetcher       = null, ISitemapParser sitemapParser = null,
                      IRobotsTxtParser robotsParser = null)
 {
     _fetcher       = fetcher ?? new WebSitemapFetcher();
     _sitemapParser = sitemapParser ?? new SitemapParser();
     _robotsParser  = robotsParser ?? new RobotsTxtParser();
 }
예제 #2
0
        public UrlsProvider(HttpClient client, ISitemapParser sitemapParser, IConfiguration configuration)
        {
            _client        = client;
            _sitemapParser = sitemapParser;

            _maxUrlsToTest        = configuration.MaxUrlsCount;
            _maxSitemapsToProcess = configuration.MaxSitemapCount;
        }
예제 #3
0
        public static async Task <Sitemap> LoadAsync(this Sitemap sitemap, ISitemapFetcher fetcher = null,
                                                     ISitemapParser parser = null)
        {
            if (sitemap == null)
            {
                throw new ArgumentNullException("sitemap");
            }

            //We are already loaded!
            if (sitemap.IsLoaded)
            {
                return(sitemap);
            }

            if (sitemap.SitemapLocation == null)
            {
                throw new InvalidOperationException("Sitemap location not specified");
            }

            var loader = new SitemapLoader(fetcher, parser);

            return(await loader.LoadAsync(sitemap));
        }
예제 #4
0
 public RobotsSitemapLoader(ISitemapFetcher fetcher = null, ISitemapParser sitemapParser = null, IRobotsTxtParser robotsParser = null)
 {
     _adapteeObject = new SitemapLoader(fetcher, sitemapParser, robotsParser);
 }