mastodon-ebooks/gen.py
Jess 3Jane a08681e737 newlines work
also did a bunch of work for future silly stuff
2018-02-21 04:06:35 -05:00

21 lines
507 B
Python

import markovify
import json
import time
from mastodon import Mastodon
api_base_url = "https://botsin.space"
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())
print("tooting")
sentence = None
# you will make that damn sentence
while sentence is None:
sentence = model.make_sentence(tries=100000)
client.toot(sentence.replace("\0", "\n"))