forked from cory/tildefriends
		
	bot: Some fixes to get SecureScuttlebuttFeed running.
This commit is contained in:
		@@ -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");
 | 
			
		||||
 
 | 
			
		||||
@@ -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