will attempt to crawl any URLs passed in on command line

This commit is contained in:
swaits committed 2015-02-15 22:58:01 -08:00
1 parent e3556df1b1
commit 5813e948f0
1 file changed
+12
+12
View File
@@ -1,5 +1,10 @@
package main
import (
"fmt"
"os"
)
// docrawl begins crawling the site at "url"
func docrawl(url string) []*Page {
// our result structure
@@ -78,4 +83,11 @@ func docrawl(url string) []*Page {
}
func main() {
// crawl each URL on the command line
for _, u := range os.Args[1:] {
pages := docrawl(u)
l := sitemapToLocations(pages)
j, _ := locationsToJSON(l)
fmt.Println(j)
}
}