29 lines
594 B
Python
29 lines
594 B
Python
import chain
|
||
import sys
|
||
import requests
|
||
|
||
import secrets__
|
||
|
||
model_f = open("model.json")
|
||
model = chain.Text.from_json(model_f.read())
|
||
|
||
generated = False
|
||
text = None
|
||
|
||
while not generated:
|
||
text = model.make_short_sentence(80, tries=900, min_words=3)
|
||
generated = text is not None
|
||
|
||
text = text.replace('@','@').replace('#','#')
|
||
print(text)
|
||
|
||
requests.post("https://brain.d.on-t.work/api/notes/create", json={
|
||
'i': secrets__.TOKEN,
|
||
|
||
'visibility': 'home',
|
||
'noExtractMentions': True,
|
||
'noExtractHashtags': True,
|
||
|
||
'text': text,
|
||
'cw': 'markov chain generated post'
|
||
})
|