diff options
Diffstat (limited to 'crawler/shop_drankdozijn.go')
| -rw-r--r-- | crawler/shop_drankdozijn.go | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/crawler/shop_drankdozijn.go b/crawler/shop_drankdozijn.go index 5cd12d5..20018af 100644 --- a/crawler/shop_drankdozijn.go +++ b/crawler/shop_drankdozijn.go @@ -71,15 +71,14 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { tmp_spirit_type := tmp_desc["description"].(string) if "Bier" == tmp_spirit_type { - DebugOffer(W, "Drankdozijn: skip offer because it's beer") + W.Debug("Drankdozijn: skip offer because it's beer") continue } W.Spirit_type = detect_spirit_type(tmp_desc["description"].(string)) if v, _ := api_data["price"]; v == nil { - //DebugOffer(W, "Drankdozijn: Skip Offer") - DebugOffer(W, "Drankdozijn: price is nil -> skip offer") + W.Debug("Drankdozijn: price is nil -> skip offer") continue } W.Original_price, err = convert_price(api_data["price"].(string)) @@ -94,7 +93,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { } if W.Discounted_price >= W.Original_price { - DebugOffer(W, "Drankdozijn: Discounted price is not cheaper") + W.Debug("Drankdozijn: Discounted price is not cheaper") continue } @@ -103,7 +102,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { // Check for bundle offer if len(tmp_offer_url_img_map) > 1 { - DebugOffer(W, "Drankdozijn: Skip Offer because of bundle") + W.Debug("Drankdozijn: Skip Offer because of bundle") continue } @@ -119,7 +118,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { c.OnHTML(".product_top", func(e *colly.HTMLElement) { if strings.Contains(W.Name, "+ gratis") || strings.Contains(W.Name, "& gratis") { - DebugOffer(W, "Drankdozijn: Skip Offer because it contains gratis ware") + W.Debug("Drankdozijn: Skip Offer because it contains gratis ware") return } @@ -132,7 +131,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { if err != nil { W.error_msg = err.Error() W.error_ctx = e.ChildText(".price_l") - PrintlnOffer(W, "Drankdozijn: Converting base price failed") + W.Println("Drankdozijn: Converting base price failed") return } }) @@ -150,7 +149,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { if W.Volume == 0 { W.error_msg = e.Text W.error_ctx = err.Error() - PrintlnOffer(W, "Drankdozijn: Volume is zero, returning") + W.Println("Drankdozijn: Volume is zero, returning") return } case "Alkoholgehalt", "Alcoholpercentage": @@ -158,7 +157,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { if W.Abv == 0 { W.error_msg = "Drankdozijn: Abv is zero" W.error_ctx = err.Error() - PrintlnOffer(W, "Drankdozijn: abv is zero") + W.Println("Drankdozijn: abv is zero") return } case "Kategorie", "Categorie": @@ -167,7 +166,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { if "Champagner" == tmp_type { if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type @@ -176,19 +175,19 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { switch W.Spirit_type { case "Cognac": if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type case "Brandy": if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type case "Sherry": if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type @@ -196,28 +195,28 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { retest_type := detect_spirit_type(W.Name) if "Likör" != retest_type && "Verschiedenes" != retest_type { if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+retest_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + retest_type) W.Spirit_type = tmp_type } W.Spirit_type = detect_spirit_type(W.Name) } if "Tequila" == tmp_type { if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type } if "Mezcal" == tmp_type { if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type } if "Baijiu" == tmp_type { if tmp_type != W.Spirit_type { - DebugOffer(W, "Spirit Type Changed: "+W.Spirit_type+" -> "+tmp_type) + W.Debug("Spirit Type Changed: " + W.Spirit_type + " -> " + tmp_type) W.Spirit_type = tmp_type } W.Spirit_type = tmp_type @@ -243,7 +242,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot { //log.Println("Visit " + W.Url) } - //DebugOffer(W, "DEBUG OFFER") + //W.Debug("DEBUG OFFER") Offers = append(Offers, W) } |
