enable posting
This commit is contained in:
parent
589fd4fe1c
commit
b90b98015b
1 changed files with 13 additions and 13 deletions
26
post.py
26
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)
|
||||
|
|
Loading…
Reference in a new issue