diff --git a/main.go b/main.go index b7497a2..3449aeb 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "log" "os" "strings" + "time" "github.com/gocolly/colly" ) @@ -19,6 +20,7 @@ type job struct { Description string `json:"description"` Link string `json:"link"` Skills skills `json:"skills"` + FirstSeen time.Time `json:"firstSeen"` } type skills struct { @@ -62,7 +64,7 @@ var ( excluded = []string{"senior", "lead", "founder", "cto", "vp of"} ) -func scrapeJobs() { +func scrapeHub() { file, err := os.Create(fName) if err != nil { @@ -129,6 +131,7 @@ func scrapeJobs() { Description: descriptionHTML, Link: e.Request.URL.String(), Skills: skillChecker(e.ChildText("content.text-block__content > span")), + FirstSeen: time.Now(), } jobs = append(jobs, jobDetails) jobCount++ @@ -152,6 +155,8 @@ func scrapeJobs() { } + + func main() { - scrapeJobs() + scrapeHub() }