From 4fdca63bb780391352eb454b7607f439e04cc629 Mon Sep 17 00:00:00 2001 From: Kay Faraday Date: Mon, 31 Jan 2022 20:36:09 +0000 Subject: [PATCH] add --simulate arg to freakpos.py --- freakpos.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/freakpos.py b/freakpos.py index 45830e6..c659fb9 100755 --- a/freakpos.py +++ b/freakpos.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import sys import anyio import qtoml import random @@ -27,9 +28,16 @@ def gen_post(messages, labels): async def main(): config = load_config() static_data = load_static() + post = gen_post(*static_data) + + print(post) + + if '--simulate' in sys.argv[1:]: + return + async with pleroma.Pleroma(api_base_url=config['site'], access_token=config['access_token']) as pl: visibility = 'direct' if config.get('test_mode', False) else 'unlisted' - await pl.post(gen_post(*static_data), visibility=visibility) + await pl.post(post, visibility=visibility) if __name__ == '__main__': anyio.run(main)