Skip to content

Commit

Permalink
Cope with paging
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
jakopako committed Jan 20, 2022
1 parent 0d8fe37 commit 115ad66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ crawlers:
layout: "15.04"
regex_extract:
exp: "[0-9]{1,2}\\.[0-9]{2}"
location: "Europe/Berlin"
language: "de_DE"
paginator:
loc: ".MarkupPagerNavNext a"
relative: true
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Event struct {
}

func (c Crawler) getEvents() ([]Event, error) {
log.Printf("fetching %s events", c.Name)
dynamicFields := []string{"title", "comment", "url", "date"}
events := []Event{}
eventType := EventType(c.Type)
Expand Down Expand Up @@ -184,7 +185,7 @@ func (c Crawler) getEvents() ([]Event, error) {
}
res.Body.Close()
}
log.Printf("fetched %d concerts from %s\n", len(events), c.Name)
log.Printf("fetched %d %s events\n", len(events), c.Name)
return events, nil
}

Expand Down

0 comments on commit 115ad66

Please sign in to comment.