From e3556df1b10fc74ef50f7382664184449e6249c5 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 22:31:18 -0800 Subject: [PATCH 1/3] flow: Created branch 'feature/url_on_command_line'. From 5813e948f00722c3ebe91f2f0b6eb38576eb5298 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 22:58:01 -0800 Subject: [PATCH 2/3] will attempt to crawl any URLs passed in on command line --- src/docrawler/docrawler.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/docrawler/docrawler.go b/src/docrawler/docrawler.go index 5f8e2dd..48de706 100644 --- a/src/docrawler/docrawler.go +++ b/src/docrawler/docrawler.go @@ -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) + } } From e867840994e6f4b47b98016c50607bf5ba6ef209 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 22:58:06 -0800 Subject: [PATCH 3/3] flow: Closed 'url_on_command_line'.