From 73cc39226d657212a84d5f00fe8ab3f168acf661 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 9 Nov 2024 09:24:13 -0500 Subject: [PATCH] bot: Some fixes to get SecureScuttlebuttFeed running. --- src/main.c | 4 ++-- tools/buttfeed.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 71bcdba9..0dfb9d2d 100644 --- a/src/main.c +++ b/src/main.c @@ -346,8 +346,8 @@ static int _tf_command_publish(const char* file, int argc, char* argv[]) { tf_printf("\n%s publish [options]\n\n", file); tf_printf("options:\n"); - tf_printf(" -y, --user user User owning identity with which to publish.\n"); - tf_printf(" -i, --identity identity Identity with which to publish message.\n"); + tf_printf(" -u, --user user User owning identity with which to publish.\n"); + tf_printf(" -i, --id identity Identity with which to publish message.\n"); tf_printf(" -d, --db-path db_path SQLite database path (default: %s).\n", k_db_path_default); tf_printf(" -c, --content json JSON content of message to publish.\n"); tf_printf(" -h, --help Show this usage information.\n"); diff --git a/tools/buttfeed.py b/tools/buttfeed.py index be14d5cf..209a5680 100755 --- a/tools/buttfeed.py +++ b/tools/buttfeed.py @@ -3,6 +3,7 @@ import argparse import feedparser import json +import subprocess import time parser = argparse.ArgumentParser() @@ -47,9 +48,9 @@ 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]) state['last_update'] = entries[0][0] if args.state_file: + content = json.dumps({'type': 'post', 'text': text, 'mentions': []}) + subprocess.check_call(['out/debug/tildefriends', 'publish', '--user', 'cory', '--id', '@DnYDqFfmxdNkYQlpflF9Wkltk2HIhJ5u1MW5njKPLzM=.ed25519', '--content', content]) with open(args.state_file, 'w') as f: json.dump(state, f) - content = json.dumps({'type': 'post', 'text': text, 'mentions': []}) - subprocess.check_call(['out/debug/tildefriends', 'publish', '--user', 'cory', '--identity', '@DnYDqFfmxdNkYQlpflF9Wkltk2HIhJ5u1MW5njKPLzM=.ed25519', '--content', content]) else: print(text)