summaryrefslogtreecommitdiffstats
path: root/randombot.py
blob: a5e58be85ff80156a3001d1d3db098cb6175d7e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
from mastodon import Mastodon
import random, os, pathlib

mastodon = Mastodon(
    access_token = 'abcdefg',
    api_base_url = 'https://domain.com/'
)

facts = open(os.path.join(pathlib.Path(__file__).parent.absolute(), 'facts.txt')).read().splitlines()
fact = random.choice(facts)
mastodon.status_post(fact)