diff --git a/tweeter.py b/tweeter.py index 1eb154b..975abf1 100755 --- a/tweeter.py +++ b/tweeter.py @@ -25,9 +25,13 @@ cur = sql_conn.cursor() while True: values = cur.execute("SELECT * FROM tweets WHERE timestamp < datetime('now')") for status in values: - original = status[0] + original = int(status[0]) recipient = status[2] comment = status[3] - api.update_status("@%s Es wär soweit... :)" % sender, twid) + try: + api.update_status("@%s Es wär soweit... :)" % recipient, original) + cur.execute("DELETE FROM tweets WHERE tweet_id = %i" % original) + except: + pass time.sleep(10)