summaryrefslogtreecommitdiff
path: root/crawler/sanitize.go
diff options
context:
space:
mode:
authorhorus2018-02-12 22:53:28 +0100
committerhorus2018-02-12 22:53:28 +0100
commitf4a905f93824b91a56b3fb7117438935ea16286f (patch)
treea3bb5a2f755194c63b449345259661d8e0db9ff7 /crawler/sanitize.go
parent87c347bfb51895499cc862a33453df9945a4656e (diff)
downloadalkobote-f4a905f93824b91a56b3fb7117438935ea16286f.tar.gz
Improvements, bug fixes, more utility functions, etc... (crawler)
Diffstat (limited to 'crawler/sanitize.go')
-rw-r--r--crawler/sanitize.go23
1 files changed, 23 insertions, 0 deletions
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)
}