-
Notifications
You must be signed in to change notification settings - Fork 0
/
mstdn.py
64 lines (50 loc) · 2.21 KB
/
mstdn.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from mastodon import Mastodon
from random import randint
"""
Mastodon.create_app(
'TF2 Markov Generator',
api_base_url = 'https://wetdry.world',
to_file = 'pytooter_clientcred.secret'
)
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
mastodon.log_in(
'the password of all time',
to_file = 'pytooter_usercred.secret'
)
"""
def gen(model, state):
if model == 0:
import models.main as model
elif model == 1:
import models.worse as model
elif model == 2:
import models.clusterfuck as model
buffer = ""
for i in range(randint(3,20)):
text = model.generate(state)
buffer = buffer + (f"- {text}\n")
return buffer
def post(text, model):
if model == 0:
prelude = "An update to Team Fortress 2 has been released. The update will be applied automatically when you restart Team Fortress 2. The major changes include:"
elif model == 1:
prelude = "An awful update to Team Fortress 2 has been released. The bullshit will be applied automatically when you restart Team Fortress 2. The major changes include:"
elif model == 2:
prelude = "An absolute clusterfuck of an update to Team Fortress 2 has been released. The shitstorm will be applied automatically when you restart Team Fortress 2. The major changes include:"
mastodon.status_post(f"{prelude} \n\n {text}", visibility="unlisted")
def returnpost(text, model):
"""
debugging function
"""
if model == 0:
prelude = "An update to Team Fortress 2 has been released. The update will be applied automatically when you restart Team Fortress 2. The major changes include:"
elif model == 1:
prelude = "An awful update to Team Fortress 2 has been released. The bullshit will be applied automatically when you restart Team Fortress 2. The major changes include:"
elif model == 2:
prelude = "An absolute clusterfuck of an update to Team Fortress 2 has been released. The shitstorm will be applied automatically when you restart Team Fortress 2. The major changes include:"
return f"{prelude} \n\n {text}"
choice = randint(0,2)
state = randint(1,4)
text = gen(choice, state)
post(text, choice)