diff options
| author | Max | 2018-02-08 16:07:46 +0100 |
|---|---|---|
| committer | Max | 2018-02-08 16:07:46 +0100 |
| commit | a418c52123969b01c37bafd67ec226410211cccf (patch) | |
| tree | 3df058820a705f5d3fd3867432fd693d4322d751 /crawler/sanitize.go | |
| parent | ca8db86baaa367e3ec0af2c68ec63d21ae3b6190 (diff) | |
| download | alkobote-a418c52123969b01c37bafd67ec226410211cccf.tar.gz | |
Crawler extracts volume, price per litre and abv. (bottleshop only)
Diffstat (limited to 'crawler/sanitize.go')
| -rw-r--r-- | crawler/sanitize.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawler/sanitize.go b/crawler/sanitize.go index c86faff..fc4ee81 100644 --- a/crawler/sanitize.go +++ b/crawler/sanitize.go @@ -91,3 +91,11 @@ func sanitize_name(name string) string { return name } + +func sanitize_price_per(price_noisy string) (price int, err error) { + if strings.Contains(price_noisy, "Preis pro Liter") { + price_noisy = strings.Replace(price_noisy, "Preis pro Liter", "", -1) + } + + return convert_price(price_noisy) +} |
