fix: ignoring buggy columns, enlarged columns
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is failing

This commit is contained in:
Paul 2020-12-26 07:16:20 +01:00
parent de85664af5
commit 6cd4f1d99c

View File

@ -96,7 +96,7 @@ func getFrsEntries(config config.Config, body string) (frsentries map[string]Qrz
for _, n := range htmlquery.Find(htmlpage, "//tr") { for _, n := range htmlquery.Find(htmlpage, "//tr") {
td := htmlquery.Find(n, "//td") td := htmlquery.Find(n, "//td")
if len(td) > 2 { if len(td) >= 6 {
if re.MatchString(htmlquery.InnerText(td[1])) { if re.MatchString(htmlquery.InnerText(td[1])) {
frs := Qrz{ frs := Qrz{
QRZ: strings.TrimLeft(htmlquery.InnerText(td[1]), " "), QRZ: strings.TrimLeft(htmlquery.InnerText(td[1]), " "),
@ -196,12 +196,12 @@ func ToSlice(qrz Qrz) (out []string) {
// Qrz describe FRS people // Qrz describe FRS people
type Qrz struct { type Qrz struct {
ID int `db:"id" xorm:"pk autoincr"` ID int `db:"id" xorm:"pk autoincr"`
QRZ string `db:"qrz" xorm:"varchar(25) notnull"` QRZ string `db:"qrz" xorm:"varchar(50) notnull"`
Name string `db:"name" xorm:"varchar(25) notnull"` Name string `db:"name" xorm:"varchar(50) notnull"`
Address string `db:"address" xorm:"varchar(50) notnull"` Address string `db:"address" xorm:"varchar(50) notnull"`
City string `db:"city" xorm:"varchar(50) notnull"` City string `db:"city" xorm:"varchar(50) notnull"`
Zipcode string `db:"zipcode" xorm:"varchar(5) notnull"` Zipcode string `db:"zipcode" xorm:"varchar(5) notnull"`
Dept string `db:"dept" xorm:"varchar(25) notnull"` Dept string `db:"dept" xorm:"varchar(50) notnull"`
Country string `db:"country" xorm:"varchar(25) notnull"` Country string `db:"country" xorm:"varchar(50) notnull"`
DMRID string `db:"dmrid" xorm:"varchar(25) notnull"` DMRID string `db:"dmrid" xorm:"varchar(50) notnull"`
} }