Quoted tweets again

This commit is contained in:
Manuel Cortez 2015-10-14 17:07:57 -05:00
parent 6c47dd2fa9
commit 0f56d8cdd4
5 changed files with 17 additions and 6 deletions

View File

@ -361,8 +361,8 @@ class baseBufferController(bufferController):
if self.name in self.session.settings["other_buffers"]["autoread_buffers"] and self.name not in self.session.settings["other_buffers"]["muted_buffers"] and self.session.settings["sound"]["session_mute"] == False:
output.speak(" ".join(tweet[:2]))
#Improve performance on Windows
if platform.system() == "Windows":
call_threaded(utils.is_audio,item)
# if platform.system() == "Windows":
# call_threaded(utils.is_audio,item)
def bind_events(self):
log.debug("Binding events...")

View File

@ -30,6 +30,6 @@ def is_long(tweet):
def clear_url(tweet):
urls = utils.find_urls_in_text(tweet["text"])
try: tweet["message"] = tweet["message"].replace(urls[-1]+".", "")
try: tweet["message"] = tweet["message"].replace(urls[-1], "")
except IndexError: pass
return tweet

View File

@ -62,7 +62,8 @@ class Session(object):
self.db[name] = []
for i in data:
if utils.find_item(i["id"], self.db[name]) == None and utils.is_allowed(i, self.settings["twitter"]["ignored_clients"]) == True:
# i = self.check_quoted_status(i)
try: i = self.check_quoted_status(i)
except: pass
if self.settings["general"]["reverse_timelines"] == False: self.db[name].append(i)
else: self.db[name].insert(0, i)
num = num+1

View File

@ -22,6 +22,7 @@ class timelinesStreamer(TwythonStreamer):
def on_error(self, status_code, data):
log.debug("%s: %s" % (status_code, data))
pub.sendMessage("stream-error")
def on_timeout(self, *args, **kwargs):
log.debug("Twitter timeout Error")
@ -33,7 +34,11 @@ class timelinesStreamer(TwythonStreamer):
if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None:
log.error("duplicated tweet. Ignoring it...")
return
data = self.session.check_quoted_status(data)
try:
data_ = self.session.check_quoted_status(data)
data = data_
except:
pass
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
else: self.session.db["%s-timeline" % (i,)].insert(0, data)
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)

View File

@ -27,6 +27,7 @@ class streamer(TwythonStreamer):
def on_error(self, status_code, data):
log.debug("Error %s: %s" % (status_code, data))
pub.sendMessage("stream-error")
def get_user(self):
return self.session.db["user_name"]
@ -36,7 +37,11 @@ class streamer(TwythonStreamer):
if utils.find_item(data["id"], self.session.db[place]) != None:
log.error("duplicated tweet. Ignoring it...")
return
# data = self.session.check_quoted_status(data)
try:
data_ = self.session.check_quoted_status(data)
data = data_
except:
pass
if self.session.settings["general"]["reverse_timelines"] == False:
self.session.db[place].append(data)
else: