Added check for non-existant lastupdate key

This commit is contained in:
A.M. Rowsell 2025-02-05 23:27:49 -05:00
parent 8683d08d1c
commit bd693f6f42
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
2 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
*.conf
*.txt
log/
*.bak

View file

@ -59,7 +59,10 @@ def main():
with open(config_file_path, "r") as config_file:
app_config = json.load(config_file)
now = time.mktime(time.localtime())
try:
last_check = app_config["lastupdate"]
except KeyError:
last_check = now - 21600 # first run, no lastupdate, check up to 6 hours ago
for i, hook in enumerate(app_config["feeds"]):
# Get the feed
feed = feedparser.parse(hook["url"])