INNER CODE UNIT · Go

fetchP7BList

demoiselle/signer · automacao-importador/verificar-cadeias-v12.go:191

func fetchP7BList() []string {
	client := &http.Client{Timeout: 20 * time.Second}
	resp, err := client.Get(INDEX_URL)
	if err != nil {
		fmt.Printf("Erro ao acessar %s: %v\n", INDEX_URL, err)
		return nil
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	re := regexp.MustCompile(`href="([^"]+\.p7b)"`)
	matches := re.FindAllStringSubmatch(string(body), -1)

	seen := make(map[string]bool)
	var files []string
	for _, m := range matches {
		parts := strings.Split(m[1], "/")
		fn := parts[len(parts)-1]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…