bot: Some fixes to get SecureScuttlebuttFeed running.

This commit is contained in:
2024-11-09 09:24:13 -05:00
parent 57257f63dd
commit 73cc39226d
2 changed files with 5 additions and 4 deletions

View File

@ -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)