finished implementation of itjobbank

This commit is contained in:
ChrQR 2024-06-11 12:08:58 +02:00
parent 32f83e358b
commit 8c9f6e2dee

28
main.go
View File

@ -12,16 +12,16 @@ import (
)
type job struct {
Title string `json:"title"`
Logo string `json:"logo"`
Company string `json:"company"`
Location string `json:"location"`
Type string `json:"type"`
Description string `json:"description"`
Link string `json:"link"`
Skills skills `json:"skills"`
FirstSeen time.Time `json:"firstSeen"`
Source string `json:"source"`
Title string `json:"title"`
Logo string `json:"logo"`
Company string `json:"company"`
Location string `json:"location"`
Type string `json:"type"`
Description string `json:"description"`
Link string `json:"link"`
Skills skills `json:"skills"`
Scraped string `json:"scraped"`
Source string `json:"source"`
}
type skills struct {
@ -80,7 +80,7 @@ func checkIfStudent(description string) string {
// Slice to store job details
var (
excluded = []string{"senior", "lead", "founder", "cto", "vp of", "erfaren", "arkitekt", "architect", "manager", "ulønnet", "unpaid", "praktik"}
excluded = []string{"senior", "lead", "founder", "cto", "vp of", "erfaren", "arkitekt", "architect", "manager", "ulønnet", "unpaid", "praktik", "cyber", "leder", "sikkerhed", "supporter"}
unpaidKeywords = []string{"unpaid", "praktik", "ulønnet"}
studentKeywords = []string{"studerende", "studenter", "student", "medhjælper"}
)
@ -162,7 +162,7 @@ func scrapeHub() {
Description: descriptionHTML,
Link: e.Request.URL.String(),
Skills: skillChecker(e.ChildText("content.text-block__content > span")),
FirstSeen: time.Now(),
Scraped: time.Now().String(),
Source: baseUrl,
}
jobs = append(jobs, jobDetails)
@ -194,7 +194,7 @@ func scrapeItJobBank() {
fName = "it-jobbank.json"
maxJobs = 30
baseUrl = "https://www.it-jobbank.dk"
searchString = "https://www.it-jobbank.dk/jobsoegning"
searchString = "https://www.it-jobbank.dk/jobsoegning/udvikling"
file, err = os.Create(fName)
)
if err != nil {
@ -257,7 +257,7 @@ func scrapeItJobBank() {
Description: descriptionHTML,
Link: e.Request.URL.String(),
Skills: skillChecker(descriptionHTML),
FirstSeen: time.Now(),
Scraped: time.Now().String(),
Source: baseUrl,
}
jobs = append(jobs, jobDetails)