16 lines
445 B
Python
Executable file
16 lines
445 B
Python
Executable file
#!/usr/bin/env python3
|
||
|
||
import dbtools, twitools
|
||
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("@", "@")
|
||
|
||
def tweet(text, ref = 0, two = twitools.twObject()):
|
||
return two.tweet(text, ref).id
|
||
|
||
if __name__ == "__main__":
|
||
tweet(markovify(getText()))
|