Skip to content
Snippets Groups Projects
Commit 06f170e9 authored by ale's avatar ale
Browse files

Update cmd/links to new scope syntax

parent 665f7ba1
No related merge requests found
...@@ -38,11 +38,11 @@ func main() { ...@@ -38,11 +38,11 @@ func main() {
flag.Parse() flag.Parse()
seeds := crawl.MustParseURLs(flag.Args()) seeds := crawl.MustParseURLs(flag.Args())
scope := []crawl.Scope{ scope := crawl.AND(
crawl.NewSchemeScope(strings.Split(*validSchemes, ",")), crawl.NewSchemeScope(strings.Split(*validSchemes, ",")),
crawl.NewDepthScope(*depth), crawl.NewDepthScope(*depth),
crawl.NewSeedScope(seeds), crawl.NewSeedScope(seeds),
} )
crawler, err := crawl.NewCrawler("crawldb", seeds, scope, crawl.FetcherFunc(http.Get), crawl.NewRedirectHandler(crawl.HandlerFunc(extractLinks))) crawler, err := crawl.NewCrawler("crawldb", seeds, scope, crawl.FetcherFunc(http.Get), crawl.NewRedirectHandler(crawl.HandlerFunc(extractLinks)))
if err != nil { if err != nil {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment