From 4c82422d2e75b9b8f4d034b1f43fda566416d6af Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 20 Dec 2014 11:41:24 +0000 Subject: make Scope checking more modular --- cmd/links/links.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmd/links/links.go') diff --git a/cmd/links/links.go b/cmd/links/links.go index 95388ce..e89e22d 100644 --- a/cmd/links/links.go +++ b/cmd/links/links.go @@ -38,7 +38,11 @@ func main() { flag.Parse() seeds := crawl.MustParseURLs(flag.Args()) - scope := crawl.NewSeedScope(seeds, *depth, strings.Split(*validSchemes, ",")) + scope := []crawl.Scope{ + crawl.NewSchemeScope(strings.Split(*validSchemes, ",")), + crawl.NewDepthScope(*depth), + crawl.NewSeedScope(seeds), + } crawler, err := crawl.NewCrawler("crawldb", seeds, scope, crawl.FetcherFunc(http.Get), crawl.HandlerFunc(extractLinks)) if err != nil { -- cgit v1.2.3-54-g00ecf