Fix edge case with missing dealer, and update README

This commit is contained in:
Dave Gallant
2023-02-25 10:31:20 -05:00
parent 85b6c979bb
commit ad58db345e
2 changed files with 11 additions and 2 deletions

View File

@@ -11,7 +11,13 @@ This was originally written before [alerts](https://www.redflagdeals.com/alerts/
## Usage ## Usage
To run the code directly, clone this repo and run the following: The simplest way to get started is to clone this repo, and run with docker:
```sh
docker run -it -v "$(pwd)/examples/config.yml:/app/config.yml" ghcr.io/davegallant/rfd-notify:1
```
To run the code with [poetry](https://python-poetry.org/), clone this repo and run the following:
```shell ```shell
poetry install poetry install

View File

@@ -63,7 +63,10 @@ def look_for_matches(
for expression in config.expressions: for expression in config.expressions:
expression = expression.lower() expression = expression.lower()
topic_title = topic.title.lower() topic_title = topic.title.lower()
dealer_name = topic.offer.dealer_name.lower() if topic.offer.dealer_name:
dealer_name = topic.offer.dealer_name.lower()
else:
dealer_name = ""
if re.search(expression, topic_title): if re.search(expression, topic_title):
found_match = True found_match = True
logger.debug( logger.debug(