Example #1
0
func crawl(url string) []string {
	fmt.Println(url)
	list, err := links.Extract(url)
	if err != nil {
		log.Print(err)
	}
	return list
}
Example #2
0
func crawl(url string) []string {
	fmt.Println(url)
	tokens <- struct{}{} // acquire a token
	list, err := links.Extract(url)
	<-tokens // release the token
	if err != nil {
		log.Print(err)
	}
	return list
}
Example #3
0
File: ex13.go Project: yyBeta/gopl
func crawl(theURL string) []string {
	fmt.Println(theURL)
	list, err := links.Extract(theURL)
	if err != nil {
		log.Print(err)
	}
	list = selectSameDomain(theURL, list)

	for _, link := range list {
		save(link)
	}

	return list
}
Example #4
0
File: ex7.go Project: yyBeta/gopl
func crawl(url string) []string {
	fmt.Println(url)
	tokens <- struct{}{} // acquire a token
	list, err := links.Extract(url)
	<-tokens // release the token
	if err != nil {
		log.Print(err)
	}

	list = selectSameDomain(url, list)
	for _, link := range list {
		save(link)
	}

	return list
}