Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jakopako committed Oct 13, 2023
1 parent e79f58a commit 63b0bca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ scrapers:
date_location: "Europe/Berlin"
filters:
- field: "title"
regex: "Verschoben.*"
exp: "Verschoben.*"
match: false
- field: "title"
regex: "Abgesagt.*"
exp: "Abgesagt.*"
match: false
```

Expand Down Expand Up @@ -424,19 +424,24 @@ Since version 0.3.0 js rendering is supported. For this to work the `google-chro

### Filters

Filters can be used to define what items should make it into the resulting list of items. A filter configuration looks as follows:
Filters can be used to define what items should make it into the resulting list of items. A filter configuration can look as follows:

```yml
filters:
- field: "status"
regex: "cancelled"
exp: "cancelled"
match: false
- field: "status"
regex: "delayed"
exp: ".*(?i)(delayed).*"
match: false
- field: "date"
exp: "> now" # format: <|> now|YYYY-MM-ddTHH:mm
match: true
```

The `field` key determines to which field the regular expression will be applied. `regex` defines the regular expression and `match` determines whether the item should be included or excluded on match. Note, that as soon as there is one match for a regular expression that has `match` set to **false** the respective item will be exlcuded from the results without looking at the other filters.
The `field` key determines to which field the expression will be applied. `exp` defines the expression and `match` determines whether the item should be included or excluded on match. Note, that as soon as there is one match for an expression that has `match` set to **false** the respective item will be excluded from the results without looking at the other filters.

The expression `exp` can be either a regular expression or a date comparison. Depending on the type of the respective `field` in the `fields` section of the configuration it has to be either one or the other. If the corresponding field is of type `date` the expression has to be a date comparison. For every other field type it has to be a regular expression.

### Interaction

Expand Down
18 changes: 9 additions & 9 deletions concerts-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ scrapers:
date_language: "it_IT"
filters:
- field: "title"
regex: ".*CANCELED.*"
exp: ".*CANCELED.*"
match: false
- field: "title"
regex: "ANNULLATO!.*"
exp: "ANNULLATO!.*"
match: false
- field: "title"
regex: ".*Postponed.*"
exp: ".*Postponed.*"
match: false
paginator:
location:
Expand Down Expand Up @@ -164,10 +164,10 @@ scrapers:
selector: ".pager__item a"
filters:
- field: "title"
regex: ".*POSTPONED.*"
exp: ".*POSTPONED.*"
match: false
- field: "title"
regex: ".*CANCELLED.*"
exp: ".*CANCELLED.*"
match: false

##########
Expand Down Expand Up @@ -321,16 +321,16 @@ scrapers:
date_location: "Europe/Berlin"
filters:
- field: "location"
regex: "Zenith" # duplicate (also present on Motorworld website)
exp: "Zenith" # duplicate (also present on Motorworld website)
match: false
- field: "location"
regex: "Strom" # duplicate
exp: "Strom" # duplicate
match: false
- field: "location"
regex: "Tonhalle" # duplicate
exp: "Tonhalle" # duplicate
match: false
- field: "location"
regex: "TonHalle" # duplicate
exp: "TonHalle" # duplicate
match: false

#########
Expand Down

0 comments on commit 63b0bca

Please sign in to comment.