diff options
| author | horus_arch | 2018-02-07 18:56:07 +0100 |
|---|---|---|
| committer | horus_arch | 2018-02-07 18:56:07 +0100 |
| commit | 576dd973b965a87bf62ca6ea792bcfb4ffac980f (patch) | |
| tree | 2df1d9cf9dbe87781262a66642255360bd2594ca | |
| parent | a7fa88733decee72291bc06f7395738a07b10555 (diff) | |
| download | alkobote-576dd973b965a87bf62ca6ea792bcfb4ffac980f.tar.gz | |
Bugfix .gitignore.
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | crawler/main.go | 41 |
2 files changed, 3 insertions, 41 deletions
@@ -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 -} |
