Move tweet() to twitools
This commit is contained in:
parent
6df747c303
commit
720411508b
3 changed files with 4 additions and 8 deletions
|
@ -24,9 +24,6 @@ def postprocess(lid, tid, db = dbtools.dbHelper()):
|
|||
db.executeQuery("UPDATE lyrics SET active = 1 WHERE ref = %i;" % int(lid))
|
||||
db.commit()
|
||||
|
||||
def tweet(text, ref = 0, two = twitools.twObject()):
|
||||
return two.tweet(text, ref).id
|
||||
|
||||
if __name__ == "__main__":
|
||||
lid, text, ref = getLyrics()
|
||||
postprocess(lid, tweet(text, ref))
|
||||
postprocess(lid, twitools.tweet(text, ref))
|
||||
|
|
|
@ -22,8 +22,5 @@ def getText(db = dbtools.dbHelper()):
|
|||
def markovifyText(text):
|
||||
return Possy(text).make_short_sentence(130).replace("@", "@")
|
||||
|
||||
def tweet(text, ref = 0, two = twitools.twObject()):
|
||||
return two.tweet(text, ref).id
|
||||
|
||||
if __name__ == "__main__":
|
||||
tweet(markovifyText(getText()))
|
||||
twitools.tweet(markovifyText(getText()))
|
||||
|
|
|
@ -42,3 +42,5 @@ def getNamesByIDs(fids=getFollowerIDs(), two=twObject()):
|
|||
for follower in followers:
|
||||
yield {"id": follower.id, "name": follower.screen_name}
|
||||
|
||||
def tweet(text, ref = 0):
|
||||
return twObject().tweet(text, ref).id
|
||||
|
|
Loading…
Reference in a new issue