now we only toot once and let cron schedule

This commit is contained in:
jess 2018-02-20 22:47:35 +01:00
parent 36e673fad9
commit d9dbd654ca
2 changed files with 7 additions and 13 deletions

View file

@ -10,6 +10,4 @@ run `python3 main.py` to login and scrape
run `pyhton3 gen.py` to make a toot run `pyhton3 gen.py` to make a toot
this will toot once every three hours after until it crashes cron is an okay choice to make it toot regularly
maybe the code won't be total jenk eventually but \shrug

6
gen.py
View file

@ -13,13 +13,9 @@ client = Mastodon(
with open("corpus.txt") as fp: with open("corpus.txt") as fp:
model = markovify.NewlineText(fp.read()) model = markovify.NewlineText(fp.read())
print("Running...")
while True:
print("tooting") print("tooting")
# This is not the best long term fix tbh # This is not the best long term fix tbh
sentence = None sentence = None
while sentence is None: while sentence is None:
sentence = model.make_sentence() sentence = model.make_sentence(tries=100000)
client.toot(sentence.replace(chr(31), "\n")) client.toot(sentence.replace(chr(31), "\n"))
print("sleeping")
time.sleep(60*60*3)