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)