summaryrefslogtreecommitdiff
path: root/crawler/shop_drankdozijn.go
diff options
context:
space:
mode:
Diffstat (limited to 'crawler/shop_drankdozijn.go')
-rw-r--r--crawler/shop_drankdozijn.go48
1 files changed, 42 insertions, 6 deletions
diff --git a/crawler/shop_drankdozijn.go b/crawler/shop_drankdozijn.go
index 850f462..b60aaa8 100644
--- a/crawler/shop_drankdozijn.go
+++ b/crawler/shop_drankdozijn.go
@@ -68,6 +68,21 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
W.Name = api_data["saleDescription"].(string)
tmp_desc := api_data["group"].(map[string]interface{})
+
+ tmp_spirit_type := tmp_desc["description"].(string)
+
+ if "Bier" == tmp_spirit_type {
+ DebugOffer(W, "Drankdozijn: skip offer because it's beer")
+ continue
+ }
+
+ /*
+ if "Wein" == tmp_spirit_type {
+ DebugOffer(W, "Drankdozijn: skip offer because it's wine")
+ continue
+ }
+ */
+
W.Spirit_type = detect_spirit_type(tmp_desc["description"].(string))
//v, ok := api_data["price"]
@@ -132,7 +147,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
*/
if strings.Contains(W.Name, "+ gratis") || strings.Contains(W.Name, "& gratis") {
- DebugOffer(W, "Drankdozijn: Skip Offer")
+ DebugOffer(W, "Drankdozijn: Skip Offer because it contains gratis ware")
return
}
@@ -205,7 +220,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
}
})
- c.OnHTML(".main_description", func(e *colly.HTMLElement) {
+ c.OnHTML(".row .main_description", func(e *colly.HTMLElement) {
//log.Println(".main_price")
prev := ""
count := 0
@@ -236,14 +251,35 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
case "Kategorie", "Categorie":
//e.Request.Ctx.Put("spirit_type", e.Text)
tmp_type := e.Text
- if tmp_type == "Likör" {
+ tmp_type = detect_spirit_type(tmp_type)
+
+ if "Champagner" == tmp_type {
+ W.Spirit_type = tmp_type
+ } else if "Cognac" == W.Spirit_type {
+ if "Calvados" == tmp_type {
+ W.Spirit_type = tmp_type
+ }
+ }
+
+ /*
+ DebugOffer(W, tmp_type)
switch tmp_type {
+ case "Champagner", "Champagne":
+ W.Spirit_type = "Champagner"
case "Tequila":
W.Spirit_type = "Tequila"
}
- }
+ */
+ /*
+ if tmp_type == "Likör" {
+ switch tmp_type {
+ case "Tequila":
+ W.Spirit_type = "Tequila"
+ }
+ }
- if tmp_type == "Wein" {
+ if tmp_type == "Wein" {
+ }
switch tmp_type {
case "Champagner", "Champagne":
W.Spirit_type = "Champagner"
@@ -251,7 +287,7 @@ func (app *App) ScrapeDrankdozijn(shop Shop) []Angebot {
DebugOffer(W, "Drankdozijn: Skip Offer")
return
}
- }
+ */
}
prev = ""