summaryrefslogtreecommitdiff
path: root/crawler/scrape.go
diff options
context:
space:
mode:
authorMaximilian Möhring2019-05-15 15:37:58 +0200
committerMaximilian Möhring2019-05-15 15:37:58 +0200
commit428ed1c35be88fbfedc1569d6e9692778c89ff25 (patch)
tree78a995637b5db2bf45f3a0e5a05a29509aac37c4 /crawler/scrape.go
parent29aa3ca0af871ea605a826d32d157441c395b569 (diff)
downloadalkobote-428ed1c35be88fbfedc1569d6e9692778c89ff25.tar.gz
Renames functions. (crawler)
Diffstat (limited to 'crawler/scrape.go')
-rw-r--r--crawler/scrape.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawler/scrape.go b/crawler/scrape.go
index 927bb48..f46b651 100644
--- a/crawler/scrape.go
+++ b/crawler/scrape.go
@@ -7,14 +7,14 @@ import (
log "github.com/sirupsen/logrus"
)
-func (app *App) ScrapeHTML(shops []Shop) {
+func (app *App) Scrape(shops []Shop) {
wait := make(chan bool)
count := 0
for _, shop := range shops {
- go app.Scrape(shop, wait)
+ go app.ScrapeShop(shop, wait)
count++
}
@@ -25,13 +25,13 @@ func (app *App) ScrapeHTML(shops []Shop) {
}
}
-func (app *App) Scrape(shop Shop, wait chan bool) {
+func (app *App) ScrapeShop(shop Shop, wait chan bool) {
var W []Angebot
var err error
// retry on error
for i := 1; i < 4; i++ {
- W = app.ScrapeShop(shop)
+ W = app.ScrapeHTML(shop)
W = sanitize_offer(W, shop, i)
@@ -59,7 +59,7 @@ func (app *App) Scrape(shop Shop, wait chan bool) {
wait <- true
}
-func (app *App) ScrapeShop(shop Shop) []Angebot {
+func (app *App) ScrapeHTML(shop Shop) []Angebot {
switch shop.Name {
case "Bottleworld":