enable posting

This commit is contained in:
Lynne Megido 2019-07-20 10:45:14 +10:00
parent 589fd4fe1c
commit b90b98015b

26
post.py
View file

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