2017-02-15 18:09:48 +00:00
|
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
2017-02-18 19:55:06 +00:00
|
|
|
|
import dbtools, setuptools, twitools
|
2017-02-15 18:09:48 +00:00
|
|
|
|
import argparse, markovify, operator, random, re, sys
|
|
|
|
|
|
|
|
|
|
def getText(db = dbtools.dbHelper()):
|
|
|
|
|
return '\n'.join(db.executeQuery("SELECT text FROM tweets;"))
|
|
|
|
|
|
|
|
|
|
def markovify(text):
|
|
|
|
|
return markovify.Text(text).make_short_sentence(130).replace("@", "@")
|
|
|
|
|
|
2017-02-18 19:47:20 +00:00
|
|
|
|
def tweet(text, ref = 0, two = twitools.twoHelper(setuptools.MARKOV)):
|
2017-02-15 18:09:48 +00:00
|
|
|
|
return two.tweet(text, ref).id
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
tweet(markovify(getText()))
|