def __init__(self, path_home, conn_sec, schema, table, consumer_key,
consumer_secret, access_token, access_token_secret,
geo=None, search_word=None):
self.geo = geo
self.path_home = path_home
self.conn_sec = conn_sec
self.conn_schema = schema
self.conn_table = table
self.search_word = search_word
self.consumer_key = consumer_key
self.consumer_secret = consumer_secret
self.access_token = access_token
self.access_token_secret = access_token_secret
self.running = False
# Create database connection to store the tweets
self.CRUD = CRUD(self.path_home, self.conn_sec)
# Create database table if it does not exist
self.create_table()
# Create the Twitter Stream object if running variable is False
while True:
if not self.running:
self.init()
评论列表
文章目录