2019-09-20 06:34:10 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# https://github.com/Lynnesbian/fediverse-bot-template
|
|
|
|
# Copyright (C) 2019 Lynne (@lynnesbian@fedi.lynnesbian.space)
|
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
# import Mastodon.py and other modules
|
|
|
|
from mastodon import Mastodon
|
|
|
|
import json, random
|
|
|
|
|
2019-09-20 07:57:14 +00:00
|
|
|
# try:
|
|
|
|
# cfg = json.load(open('config.json', 'r'))
|
|
|
|
# except:
|
|
|
|
# print("Couldn't load config.json. Make sure you run login.py first!\n-----")
|
|
|
|
# raise
|
2019-09-20 06:34:10 +00:00
|
|
|
meta = json.load(open('meta.json', 'r'))
|
2019-09-20 07:12:17 +00:00
|
|
|
takes = json.load(open('takes.json'))
|
2019-09-20 06:34:10 +00:00
|
|
|
|
2019-09-20 07:57:14 +00:00
|
|
|
take = random.choice(takes['templates']).format(
|
|
|
|
ideology = random.choice(takes['ideologies']),
|
|
|
|
ideology2 = random.choice(takes['ideologies']),
|
|
|
|
thing = random.choice(takes['things']),
|
|
|
|
thing2 = random.choice(takes['things']),
|
|
|
|
thing3 = random.choice(takes['things']),
|
|
|
|
site = random.choice(takes['sites']),
|
|
|
|
ideolog = random.choice([i[:-1] + "t" for i in takes['ideologies'] if i.endswith("ism")])
|
|
|
|
)
|
2019-09-20 06:34:10 +00:00
|
|
|
|
2019-09-20 07:57:14 +00:00
|
|
|
print(take)
|
|
|
|
|
|
|
|
# # 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!
|
|
|
|
# # if you delete this line, you can also remove the random module from the imports list.
|
|
|
|
# client.status_post("Hi! Your random number is: {}".format(random.randint(0,10000)))
|