From 2624eed96b20ca71d3f026f38e87b0db66504942 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Thu, 4 Apr 2019 16:43:22 +0200 Subject: [PATCH] Fix: If last-updated is not given in config, no feeds are pushed. The bug was: If last-updated was not given in the config, the current date and time was used, inhibiting posting "old" entries. Todo: Add an option to ask whether "old" entries shall be posted on first run. --- feediverse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/feediverse.py b/feediverse.py index a8e4819..fff9c1a 100755 --- a/feediverse.py +++ b/feediverse.py @@ -10,7 +10,7 @@ import feedparser from bs4 import BeautifulSoup from mastodon import Mastodon -from datetime import datetime, timezone +from datetime import datetime, timezone, MINYEAR import urllib3 @@ -73,7 +73,8 @@ def read_config(config_file): if 'updated' in config: config['updated'] = dateutil.parser.parse(config['updated']) else: - config['updated'] = datetime.now(tz=timezone.utc) + config['updated'] = datetime(MINYEAR, 1, 1, + 0, 0, 0, 0, timezone.utc) return config def detect_generator(feed):