From f4a905f93824b91a56b3fb7117438935ea16286f Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 12 Feb 2018 22:53:28 +0100 Subject: Improvements, bug fixes, more utility functions, etc... (crawler) --- crawler/sanitize.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crawler/sanitize.go') diff --git a/crawler/sanitize.go b/crawler/sanitize.go index a40745a..7a2ff58 100644 --- a/crawler/sanitize.go +++ b/crawler/sanitize.go @@ -13,6 +13,29 @@ func sanitize_offer(angebote []Angebot) []Angebot { for _, offer := range angebote { offer.Name = sanitize_name(offer.Name) + if offer.Abv == 0 { + log.Println("sanitize.go: abv zero: " + offer.Name + "( " + offer.Url + ")") + continue + } + if offer.Volume == 0 { + log.Println("sanitize.go: volume zero: " + offer.Name + "( " + offer.Url + ")") + continue + } + if offer.Discounted_price == 0 { + log.Println("sanitize.go: discounted_price zero: " + offer.Name + "( " + offer.Url + ")") + continue + } + if offer.Original_price == 0 { + log.Println("sanitize.go: original_price zero: " + offer.Name + "( " + offer.Url + ")") + continue + } + if offer.Base_price == 0 { + log.Println("sanitize.go: base_price zero: " + offer.Name + "( " + offer.Url + ")") + continue + } + + //offer.Website = "" + W = append(W, offer) } -- cgit v1.2.3