Esempio n. 1
0
func LeetcodeProblems() map[string]string {
	problems := crawler.BasicCrawler(TARGET_URL, 2, CheckUrl)
	for u, _ := range problems {
		fmt.Println("LeetcodeProblems(): ", u)
	}
	fmt.Println("Total Problem Number: ", len(problems))
	return problems
}
Esempio n. 2
0
func main() {
	var targetUrl string
	flag.StringVar(&targetUrl, "t", "http://www.tmall.com", "Target url.")
	var maxDepth int
	flag.IntVar(&maxDepth, "d", 1, "Max Depth.")
	flag.Parse()
	res := crawler.BasicCrawler(targetUrl, maxDepth, DummyFilter)
	for u, v := range res {
		fmt.Println(u, " - size: ", len(v))
	}
	fmt.Println("Total: ", len(res))
}