-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.go
33 lines (27 loc) · 1.2 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"flag"
"github.com/aforward/webl/api"
)
func main() {
isVerbose := flag.Bool("verbose", false, "Turn on as musch debugging information as possible")
isQuiet := flag.Bool("quiet", false, "Turn off all but the most important logging")
isTimestamped := flag.Bool("timestamped", false, "Should outputs be timestamped")
isVersion := flag.Bool("version", false, "Output the version of this app")
startingUrl := flag.String("url", "", "Specify which URL to crawl (e.g. a4word.com)")
redisServer := flag.String("redis", ":6379", "Specify the redis server (e.g. 127.0.0.1:6379)")
redisPassword := flag.String("redis-password", "", "Specify the redis server password")
saveDir := flag.String("dir", "./sitemaps", "Specify where to save the sitemap xml file")
flag.Parse()
webl.InitLogging(*isQuiet, *isVerbose, *isTimestamped, nil)
showVersion()
if *isVersion {
return
}
if *startingUrl == "" {
showMissingUrl()
return
}
webl.Pool = webl.NewPool(*redisServer, *redisPassword)
webl.Crawl(*startingUrl, *saveDir)
}