diff --git a/post.py b/post.py index 869076b..9be26fd 100755 --- a/post.py +++ b/post.py @@ -16,19 +16,19 @@ from mastodon import Mastodon import json, random -# try: -# cfg = json.load(open('config.json', 'r')) -# except: -# print("Couldn't load config.json. Make sure you run main.py first!\n-----") -# raise -# meta = json.load(open('meta.json', 'r')) +try: + cfg = json.load(open('config.json', 'r')) +except: + print("Couldn't load config.json. Make sure you run main.py first!\n-----") + raise +meta = json.load(open('meta.json', 'r')) -# # log in -# client = Mastodon( -# client_id=cfg['client']['id'], -# client_secret=cfg['client']['secret'], -# access_token=cfg['secret'], -# api_base_url=cfg['site']) +# log in +client = Mastodon( + client_id=cfg['client']['id'], + client_secret=cfg['client']['secret'], + access_token=cfg['secret'], + api_base_url=cfg['site']) # make a post! data = json.load(open('data.json', 'r')) @@ -74,4 +74,4 @@ elif thought_type == "item-stall": else: thought = thought.format(get_object(thought_type)) -print(thought) +client.status_post(thought)