forked from cory/tildefriends
bot: Some fixes to get SecureScuttlebuttFeed running.
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user