famduino gets a voice

import twitter
import os
from time import sleep
from pipes import quote
 
api = twitter.Api(consumer_key='',
consumer_secret='',
access_token_key='',
access_token_secret='',
input_encoding='utf-8')
 
sid_file = open('/home/familab/sid.famduino','r+')
cache_sid = sid_file.readline()
if cache_sid == "":
    sid = 0
else:
    sid = int(cache_sid)
print "Current sid: "+str(sid)
sid_file.close()
 
replies = api.GetReplies(since_id = int(sid))
 
for item in replies:
    print item.id
    if item.id > sid:
        sid = int(item.id)
        sid_file = open('/home/familab/sid.famduino','w')
        sid_file.write(str(sid))
        sid_file.close()
        print "New sid: "+str(sid)
 
    os.system("flite -voice rms -t "+quote(item.text))
    print item.text

About Willa

Infosec princess with a penchant for secure coding, hacker, mother of one, and wife of @nifty_ba.