New fields
This commit is contained in:
parent
3f3eeeeabb
commit
6201a4919b
4
main.go
4
main.go
@ -21,6 +21,8 @@ type Call struct {
|
||||
Num string `json:"num"`
|
||||
Date string `json:"date"`
|
||||
Call string `json:"call"`
|
||||
Id string `json:"id"`
|
||||
Sec string `json:"sec"`
|
||||
Slot string `json:"slot"`
|
||||
Talkgroup string `json:"talkgroup"`
|
||||
}
|
||||
@ -53,7 +55,7 @@ func scrape(config *Config, callback chan []Call) {
|
||||
c.OnHTML("table > tbody", func(h *colly.HTMLElement) {
|
||||
h.ForEach("tr", func(_ int, el *colly.HTMLElement) {
|
||||
if el.ChildText("td:nth-child(1)") != "" {
|
||||
this_call := Call{Num: el.ChildText("td:nth-child(1)"), Date: el.ChildText("td:nth-child(3)"), Call: el.ChildText("td:nth-child(8)"), Slot: el.ChildText("td:nth-child(10)"), Talkgroup: el.ChildText("td:nth-child(11)")}
|
||||
this_call := Call{Num: el.ChildText("td:nth-child(1)"), Date: el.ChildText("td:nth-child(3)"), Call: el.ChildText("td:nth-child(8)"), Id: el.ChildText("td:nth-child(7)"), Sec: el.ChildText("td:nth-child(4)"), Slot: el.ChildText("td:nth-child(10)"), Talkgroup: el.ChildText("td:nth-child(11)")}
|
||||
new_calls = append(new_calls, this_call)
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user