2018-02-18 15:38:21 -05:00
|
|
|
import markovify
|
|
|
|
import json
|
2018-02-20 11:51:25 -05:00
|
|
|
import time
|
2018-02-18 15:38:21 -05:00
|
|
|
from mastodon import Mastodon
|
|
|
|
|
2018-02-19 16:57:50 -05:00
|
|
|
api_base_url = "https://botsin.space"
|
2018-02-18 15:38:21 -05:00
|
|
|
|
|
|
|
client = Mastodon(
|
|
|
|
client_id="clientcred.secret",
|
|
|
|
access_token="usercred.secret",
|
|
|
|
api_base_url=api_base_url)
|
|
|
|
|
|
|
|
with open("corpus.txt") as fp:
|
|
|
|
model = markovify.NewlineText(fp.read())
|
|
|
|
|
2018-02-20 16:47:35 -05:00
|
|
|
print("tooting")
|
|
|
|
sentence = None
|
2018-02-21 04:06:35 -05:00
|
|
|
# you will make that damn sentence
|
2018-02-20 16:47:35 -05:00
|
|
|
while sentence is None:
|
|
|
|
sentence = model.make_sentence(tries=100000)
|
2018-02-21 04:06:35 -05:00
|
|
|
client.toot(sentence.replace("\0", "\n"))
|