Commit db830663 authored by furion's avatar furion Committed by GitHub

Fix #851 (#877)

parent 5c81ecd9
...@@ -104,7 +104,7 @@ def init(db): ...@@ -104,7 +104,7 @@ def init(db):
); );
""" """
cursor.execute(table_retweets) cursor.execute(table_retweets)
table_reply_to = """ table_reply_to = """
CREATE TABLE IF NOT EXISTS CREATE TABLE IF NOT EXISTS
replies( replies(
...@@ -245,7 +245,7 @@ def tweets(conn, Tweet, config): ...@@ -245,7 +245,7 @@ def tweets(conn, Tweet, config):
entry = (Tweet.id, entry = (Tweet.id,
Tweet.id_str, Tweet.id_str,
Tweet.tweet, Tweet.tweet,
Tweet.language, Tweet.lang,
Tweet.conversation_id, Tweet.conversation_id,
Tweet.datetime, Tweet.datetime,
Tweet.datestamp, Tweet.datestamp,
...@@ -284,7 +284,7 @@ def tweets(conn, Tweet, config): ...@@ -284,7 +284,7 @@ def tweets(conn, Tweet, config):
query = 'INSERT INTO retweets VALUES(?,?,?,?,?)' query = 'INSERT INTO retweets VALUES(?,?,?,?,?)'
_d = datetime.timestamp(datetime.strptime(Tweet.retweet_date, "%Y-%m-%d %H:%M:%S")) _d = datetime.timestamp(datetime.strptime(Tweet.retweet_date, "%Y-%m-%d %H:%M:%S"))
cursor.execute(query, (int(Tweet.user_rt_id), Tweet.user_rt, Tweet.id, int(Tweet.retweet_id), _d)) cursor.execute(query, (int(Tweet.user_rt_id), Tweet.user_rt, Tweet.id, int(Tweet.retweet_id), _d))
if Tweet.reply_to: if Tweet.reply_to:
for reply in Tweet.reply_to: for reply in Tweet.reply_to:
query = 'INSERT INTO replies VALUES(?,?,?)' query = 'INSERT INTO replies VALUES(?,?,?)'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment