Commit 63600485 authored by Cody Zacharias's avatar Cody Zacharias Committed by GitHub

Update spacing / Add values

parent bbe48859
......@@ -21,9 +21,12 @@ def init(db):
retweets integer,
hashtags text,
link text
retweet bool,
user_rt text
);
"""
cursor.execute(table_tweets)
table_users = """
CREATE TABLE IF NOT EXISTS
users (
......@@ -34,6 +37,7 @@ def init(db):
);
"""
cursor.execute(table_users)
table_search = """
CREATE TABLE IF NOT EXISTS
searches (
......@@ -45,6 +49,7 @@ def init(db):
);
"""
cursor.execute(table_search)
table_followers = """
CREATE TABLE IF NOT EXISTS
followers (
......@@ -55,6 +60,7 @@ def init(db):
);
"""
cursor.execute(table_followers)
table_following = """
CREATE TABLE IF NOT EXISTS
following (
......@@ -65,6 +71,7 @@ def init(db):
);
"""
cursor.execute(table_following)
return conn
except Exception as e:
return str(e)
......@@ -95,17 +102,17 @@ def tweets(conn, Tweet):
entry = (Tweet.id,
Tweet.user_id,
Tweet.datestamp,
Tweet.timestamp,
Tweet.timezone,
Tweet.location,
Tweet.username,
Tweet.tweet,
Tweet.replies,
Tweet.likes,
Tweet.retweets,
",".join(Tweet.hashtags),
Tweet.link,)
cursor.execute("INSERT INTO tweets VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)", entry)
Tweet.link,
Tweet.is_retweet,
Tweet.user_rt)
cursor.execute('INSERT INTO tweets VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)', entry)
conn.commit()
except sqlite3.IntegrityError:
pass
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