diff options
| author | Maximilian Möhring | 2021-01-12 08:28:32 +0100 |
|---|---|---|
| committer | Maximilian Möhring | 2021-01-12 08:28:32 +0100 |
| commit | 807f6050c24dc011d24357c9252ca758104eb832 (patch) | |
| tree | fdefc1350755958540390e5f818db720fe95bfd2 /crawler | |
| parent | 9c47d6f22be8078e3df29c6d9bbab7a5bb241f01 (diff) | |
| download | alkobote-807f6050c24dc011d24357c9252ca758104eb832.tar.gz | |
Accepts sparkling wine from d12.
Diffstat (limited to 'crawler')
| -rw-r--r-- | crawler/shop_drankdozijn.go | 9 | ||||
| -rw-r--r-- | crawler/utility.go | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/crawler/shop_drankdozijn.go b/crawler/shop_drankdozijn.go index 3d2a840..8cf18ba 100644 --- a/crawler/shop_drankdozijn.go +++ b/crawler/shop_drankdozijn.go @@ -206,8 +206,13 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { log.Println("extracting volume failed") } } else if v.Description == "Kategorie" { - tmp_type := detect_spirit_type(v.Value.Description) - if "Champagner" == tmp_type { + var tmp_type string + if "Moussierend" == v.Value.Description { + tmp_type = "Sekt" + } else { + tmp_type = detect_spirit_type(v.Value.Description) + } + if "Champagner" == tmp_type || "Sekt" == tmp_type { if tmp_type != W.Spirit_type { W.Trace("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type diff --git a/crawler/utility.go b/crawler/utility.go index 57f0e7b..b7ae958 100644 --- a/crawler/utility.go +++ b/crawler/utility.go @@ -73,7 +73,7 @@ func detect_spirit_type(name string) string { if matched { return "Champagner" } - matched, err = regexp.MatchString(`(^|\s)(sekt|cremant|prosecco)(\s|$)`, name) + matched, err = regexp.MatchString(`(^|\s)(sekt|cremant|prosecco|cava)(\s|$)`, name) if err != nil { Fatal(err, "Sekt|Cremant regex failed") } |
