added config.json to make changing api base url easier
This commit is contained in:
parent
2858e7c960
commit
e4d661caa6
3 changed files with 17 additions and 13 deletions
6
gen.py
6
gen.py
|
|
@ -4,7 +4,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from mastodon import Mastodon
|
||||
import argparse, sys, traceback
|
||||
import argparse, sys, traceback, json
|
||||
import create
|
||||
|
||||
parser = argparse.ArgumentParser(description='Generate and post a toot.')
|
||||
|
|
@ -15,12 +15,12 @@ parser.add_argument('-s', '--simulate', dest='simulate', action='store_true',
|
|||
|
||||
args = parser.parse_args()
|
||||
|
||||
api_base_url = "https://botsin.space" #todo: this shouldn't be hardcoded
|
||||
cfg = json.load(open('config.json', 'r'))
|
||||
|
||||
client = Mastodon(
|
||||
client_id="clientcred.secret",
|
||||
access_token="usercred.secret",
|
||||
api_base_url=api_base_url)
|
||||
api_base_url=cfg['site'])
|
||||
|
||||
toot = create.make_toot()
|
||||
if not args.simulate:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue