import f_mine import sqlite3 as lite import sys consumer_key = 'bfoN8IIW5YUN5tKD7vRaJJ5aY' consumer_secret = 'pZw1UCPbjDQjrTp01IgZL36h4JOo3U0GrokaRUNMHVUVRY6yiq' access_token = '1349515753-oGbkzRBurZRAO5AopHY2ZZDbWEtWfeGjqOs6G3X' access_token_secret = 'fmXsNFxwF3vQYSdlofPzIUafdCtAQ2yex0rW96HAbsHoh' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) max_tweets = 1000 searched_tweets = f_mine.mine(api, '#VoteCruz', max_tweets) print len(searched_tweets) format_sql = [] for tw in searched_tweets: format_sql.append((tw.author.screen_name, ' '.join(tw.text.splitlines()))) con = lite.connect('cruz4.db') with con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Cruz") cur.execute("CREATE TABLE Cruz( \ Id INTEGER PRIMARY KEY, \
import f_mine import sqlite3 as lite import sys consumer_key = 'bfoN8IIW5YUN5tKD7vRaJJ5aY' consumer_secret = 'pZw1UCPbjDQjrTp01IgZL36h4JOo3U0GrokaRUNMHVUVRY6yiq' access_token = '1349515753-oGbkzRBurZRAO5AopHY2ZZDbWEtWfeGjqOs6G3X' access_token_secret = 'fmXsNFxwF3vQYSdlofPzIUafdCtAQ2yex0rW96HAbsHoh' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) max_tweets = 1000 searched_tweets = f_mine.mine(api, '#VoteHillary', max_tweets) print len(searched_tweets) format_sql = [] for tw in searched_tweets: format_sql.append((tw.author.screen_name, ' '.join(tw.text.splitlines()))) con = lite.connect('clinton4.db') with con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Clinton") cur.execute("CREATE TABLE Clinton( \ Id INTEGER PRIMARY KEY, \
import tweepy import f_mine consumer_key = 'bfoN8IIW5YUN5tKD7vRaJJ5aY' consumer_secret = 'pZw1UCPbjDQjrTp01IgZL36h4JOo3U0GrokaRUNMHVUVRY6yiq' access_token = '1349515753-oGbkzRBurZRAO5AopHY2ZZDbWEtWfeGjqOs6G3X' access_token_secret = 'fmXsNFxwF3vQYSdlofPzIUafdCtAQ2yex0rW96HAbsHoh' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) max_tweets = 5 searched_tweets = f_mine.mine(api, '#ImWithHer', max_tweets) for tw in searched_tweets: print '{0} ({1}): '.format(tw.author.screen_name, tw.author.location) \ + tw.text
import f_mine import sqlite3 as lite import sys consumer_key = 'bfoN8IIW5YUN5tKD7vRaJJ5aY' consumer_secret = 'pZw1UCPbjDQjrTp01IgZL36h4JOo3U0GrokaRUNMHVUVRY6yiq' access_token = '1349515753-oGbkzRBurZRAO5AopHY2ZZDbWEtWfeGjqOs6G3X' access_token_secret = 'fmXsNFxwF3vQYSdlofPzIUafdCtAQ2yex0rW96HAbsHoh' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) max_tweets = 1000 searched_tweets = f_mine.mine(api, '#VoteTrump', max_tweets) print len(searched_tweets) format_sql = [] for tw in searched_tweets: format_sql.append((tw.author.screen_name, ' '.join(tw.text.splitlines()))) con = lite.connect('trump4.db') with con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Trump") cur.execute("CREATE TABLE Trump( \ Id INTEGER PRIMARY KEY, \
import f_mine import sqlite3 as lite import sys consumer_key = 'bfoN8IIW5YUN5tKD7vRaJJ5aY' consumer_secret = 'pZw1UCPbjDQjrTp01IgZL36h4JOo3U0GrokaRUNMHVUVRY6yiq' access_token = '1349515753-oGbkzRBurZRAO5AopHY2ZZDbWEtWfeGjqOs6G3X' access_token_secret = 'fmXsNFxwF3vQYSdlofPzIUafdCtAQ2yex0rW96HAbsHoh' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) max_tweets = 1000 searched_tweets = f_mine.mine(api, '#VoteBernie', max_tweets) print len(searched_tweets) format_sql = [] for tw in searched_tweets: format_sql.append((tw.author.screen_name, ' '.join(tw.text.splitlines()))) con = lite.connect('sanders4.db') with con: cur = con.cursor() cur.execute("DROP TABLE IF EXISTS Sanders") cur.execute("CREATE TABLE Sanders( \ Id INTEGER PRIMARY KEY, \