2023-01-11 16:05:20 -08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2022-11-23 00:55:53 -08:00
|
|
|
import random
|
2023-01-12 18:38:15 -08:00
|
|
|
from conjugate import conjugate
|
2022-11-23 00:55:53 -08:00
|
|
|
from mastodon import Mastodon
|
2023-01-11 16:19:04 -08:00
|
|
|
import json5 as json
|
2022-11-23 00:55:53 -08:00
|
|
|
|
2023-01-11 16:19:04 -08:00
|
|
|
with open('config.json') as f:
|
|
|
|
config = json.load(f)
|
2022-11-23 00:55:53 -08:00
|
|
|
|
|
|
|
mastodon = Mastodon(
|
2023-01-11 16:19:04 -08:00
|
|
|
access_token=config['access_token'],
|
|
|
|
api_base_url=config['site'],
|
2022-11-23 00:55:53 -08:00
|
|
|
)
|
|
|
|
|
2023-01-11 22:00:25 -08:00
|
|
|
with open('adjectives.txt') as f:
|
|
|
|
adjectives = list(map(str.rstrip, f))
|
|
|
|
|
|
|
|
with open('verbs.txt') as f:
|
|
|
|
verbs = list(map(str.rstrip, f))
|
|
|
|
|
2023-01-11 16:05:20 -08:00
|
|
|
postform = random.choice((
|
|
|
|
'{adjective} {gender} who {verb}',
|
|
|
|
'{adjective} {gender}',
|
|
|
|
'{gender} who {verb}',
|
|
|
|
))
|
2023-01-11 16:19:04 -08:00
|
|
|
gender = random.choice(('lgf', 'lbf', 'lef'))
|
2023-01-12 18:38:15 -08:00
|
|
|
verb = conjugate(random.choice(verbs))
|
2022-11-23 00:55:53 -08:00
|
|
|
adjective = random.choice(adjectives)
|
2023-01-11 16:05:20 -08:00
|
|
|
content = postform.format(adjective=adjective, gender=gender, verb=verb)
|
2022-11-23 00:55:53 -08:00
|
|
|
print(content)
|
2023-01-11 16:05:20 -08:00
|
|
|
mastodon.status_post(content, visibility='unlisted')
|