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
|
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)
|
||||||
|
|
Loading…
Reference in a new issue