From 576dd973b965a87bf62ca6ea792bcfb4ffac980f Mon Sep 17 00:00:00 2001 From: horus_arch Date: Wed, 7 Feb 2018 18:56:07 +0100 Subject: Bugfix .gitignore. --- .gitignore | 3 ++- crawler/main.go | 41 +---------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 9b5548a..7e73b1c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ *.db alkobote.de tmp.txt -crawler +crawler/crawler +crawler/config.json lumen diff --git a/crawler/main.go b/crawler/main.go index 5255e1c..0066530 100644 --- a/crawler/main.go +++ b/crawler/main.go @@ -83,16 +83,7 @@ func main() { log.Fatal(err) } - W := ScrapeHTML(shops) - - err = app.save_offer(W) - if err != nil { - log.Fatal(err) - } - err = app.remove_expired(W) - if err != nil { - log.Fatal(err) - } + app.ScrapeHTML(shops) } func printName(W []Angebot, name string) { @@ -108,33 +99,3 @@ func printName(W []Angebot, name string) { fmt.Println(string(output)) } - -func ScrapeHTML(shops []Shop) []Angebot { - var W []Angebot - - for _, shop := range shops { - - switch shop.Name { - case "Bottleworld": - W = append(W, ScrapeBottleWord(shop)...) - case "MC Whisky": - W = append(W, ScrapeMCWhisky(shop)...) - case "Rum & Co": - W = append(W, ScrapeRumundCo(shop)...) - case "Whic": - W = append(W, ScrapeWhic(shop)...) - case "Whisky.de": - W = append(W, ScrapeWhiskyde(shop)...) - case "Whiskysite.nl": - W = append(W, ScrapeWhiskysitenl(shop)...) - case "Whisky World": - W = append(W, ScrapeWhiskyworld(shop)...) - case "Whiskyzone": - W = append(W, ScrapeWhiskyzone(shop)...) - default: - log.Println(shop.Name + ": No Crawler") - } - } - - return W -} -- cgit v1.2.3