-
-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathscrape.go
More file actions
26 lines (21 loc) · 610 Bytes
/
Copy pathscrape.go
File metadata and controls
26 lines (21 loc) · 610 Bytes
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
package main
import (
"log"
"github.com/lawzava/emailscraper"
"github.com/spf13/cobra"
)
//nolint:gochecknoglobals,exhaustruct // not valid requirement for this use case
var rootCmd = &cobra.Command{
Use: "scrape",
Short: "CLI utility to scrape emails from websites",
Long: `CLI utility that scrapes emails from specified website recursively and concurrently`,
Run: func(_ *cobra.Command, _ []string) {
scraper := emailscraper.New(scraperParameters)
// Scrape for emails
scrapedEmails, err := scraper.Scrape(url)
if err != nil {
log.Fatal(err)
}
handleOutput(scrapedEmails)
},
}