From e0dde90b7da98999e355b00266bde8b75f01d9b6 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Tue, 16 Apr 2019 12:38:43 +0200 Subject: [PATCH] On setup ask whether existing entries shall be tooted, too. --- feediverse.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/feediverse.py b/feediverse.py index 3f0a409..72a0a32 100755 --- a/feediverse.py +++ b/feediverse.py @@ -61,9 +61,10 @@ def main(): media_ids=media_ids) save_config(config, config_file) -def save_config(config, config_file): +def save_config(config, config_file, toot_old_posts=False): copy = dict(config) - copy['updated'] = datetime.now(tz=timezone.utc).isoformat() + if not toot_old_posts: + copy['updated'] = datetime.now(tz=timezone.utc).isoformat() with open(config_file, 'w') as fh: fh.write(yaml.dump(copy, default_flow_style=False)) @@ -196,6 +197,7 @@ def setup(config_file): access_token = m.log_in(username, password) feed_url = input('RSS/Atom feed URL to watch: ') + old_posts = yes_no('Shall already existing entries be tooted, too?') config = { 'name': name, 'url': url, @@ -206,7 +208,7 @@ def setup(config_file): {'url': feed_url, 'template': '{title} {url}'} ] } - save_config(config, config_file) + save_config(config, config_file, old_posts) print("") print("Your feediverse configuration has been saved to {}".format(config_file)) print("Add a line line this to your crontab to check every 15 minutes:")