From 44ebb841f04deeb06957abc2e908f0f13c7234f4 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 10 Nov 2024 19:30:36 -0500 Subject: [PATCH] bot: Fix empty buttfeed posts, and use requested RSS feed for Habitat. --- tools/buttfeed.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/buttfeed.py b/tools/buttfeed.py index 209a5680..cf1ea18f 100755 --- a/tools/buttfeed.py +++ b/tools/buttfeed.py @@ -13,8 +13,7 @@ args = parser.parse_args() k_feeds = { 'tildefriends': 'https://dev.tildefriends.net/cory/tildefriends.rss', 'erlbutt': 'https://github.com/cmoid/erlbutt/commits/main.atom', - 'habitat': 'https://gitlab.com/quickdudley/habitat/-/commits/main.atom', - 'habitat': 'https://gitlab.com/quickdudley/habitat/-/commits/internet.atom', + 'habitat': 'https://tildegit.org/jeremylist/habitat.rss', 'manyverse': 'https://gitlab.com/staltz/manyverse/-/commits/master?format=atom', 'ahau': 'https://gitlab.com/ahau/ahau/-/commits/master.atom', } @@ -43,9 +42,9 @@ if args.state_file: pass cutoff = state.get('last_update') or (time.time() - 2 * 7 * 24 * 60 * 60) -entries = get_entries() +entries = [entry for entry in get_entries() if entry[0] > cutoff] if entries: - text = '# Recent Secure Scuttlebutt Development Activity\n\n' + '\n'.join([f' * [{entry[1]}] [{entry[3]}]({entry[2]})' for entry in entries if entry[0] > cutoff]) + text = '# Recent Secure Scuttlebutt Development Activity\n\n' + '\n'.join([f' * [{entry[1]}] [{entry[3]}]({entry[2]})' for entry in entries]) state['last_update'] = entries[0][0] if args.state_file: content = json.dumps({'type': 'post', 'text': text, 'mentions': []})