summaryrefslogtreecommitdiff
path: root/crawler/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'crawler/main.go')
-rw-r--r--crawler/main.go41
1 files changed, 1 insertions, 40 deletions
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
-}