Exemplo n.º 1
0
func crawl(url string) []string {
	fmt.Println(url)
	list, err := links.Extract(url)
	if err != nil {
		log.Println(err)
	}
	return list
}
Exemplo n.º 2
0
func localLinks(url string) []string {
	basename := links.baseURL(url)
	var local []string
	list, err := links.Extract(url)
	if err != nil {
		log.Println(err)
	}
	for _, checkURL := range list {
		index := strings.Index(checkURL, basename)
		if index != -1 {
			local = append(local, checkURL)
			fmt.Println(checkURL)
		}
	}
	return local
}