flow: Merged <feature> 'url_on_command_line' to <develop> ('develop').
This commit is contained in:
commit
81e673a6bc
1 file changed
+12
@@ -1,5 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
// docrawl begins crawling the site at "url"
|
// docrawl begins crawling the site at "url"
|
||||||
func docrawl(url string) []*Page {
|
func docrawl(url string) []*Page {
|
||||||
// our result structure
|
// our result structure
|
||||||
@@ -78,4 +83,11 @@ func docrawl(url string) []*Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user