diff --git a/src/twitter/buffers/indibidual.py b/src/twitter/buffers/indibidual.py index f6340a96..5c3d9781 100644 --- a/src/twitter/buffers/indibidual.py +++ b/src/twitter/buffers/indibidual.py @@ -30,6 +30,9 @@ class timelinesStreamer(TwythonStreamer): def check_tls(self, data): for i in self.session.settings["other_buffers"]["timelines"]: if data["user"]["screen_name"] == i: + if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None: + log.error("duplicated tweet. Ignoring it...") + return 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) diff --git a/src/twitter/buffers/stream.py b/src/twitter/buffers/stream.py index 6345cf51..936d5b2c 100644 --- a/src/twitter/buffers/stream.py +++ b/src/twitter/buffers/stream.py @@ -33,6 +33,9 @@ class streamer(TwythonStreamer): def put_data(self, place, data): if self.session.db.has_key(place): + if utils.find_item(data["id"], self.session.db[place]) != None: + log.error("duplicated tweet. Ignoring it...") + return if self.session.settings["general"]["reverse_timelines"] == False: self.session.db[place].append(data) else: