import tweepy
import mysql.connector
consumer_key = '6Q8zYIUxsH7NuWXs505STGTiC'
consumer_secret = '<KEY>'
access_token = '<KEY>'
access_token_secret = '<KEY>'
try:
	auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
	redirect_url = auth.get_authorization_url()
except tweepy.TweepError:
	print 'Error! Failed to get request token.' 
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
cnx = mysql.connector.connect(user='root', database='traffic')
cursor = cnx.cursor()
query = ("SELECT * FROM temp")
cursor.execute(query)
for (a, b) in cursor:
	api.update_status('#'+a+b)
cursor.close()
cnx.close()

import tweepy
import mysql.connector
consumer_key = '6Q8zYIUxsH7NuWXs505STGTiC'
consumer_secret = '<KEY>'
access_token = '<KEY>'
access_token_secret = '<KEY>'
try:
	auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
	redirect_url = auth.get_authorization_url()
except tweepy.TweepError:
	print 'Error! Failed to get request token.' 
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
cnx = mysql.connector.connect(user='root', database='traffic')
cursor = cnx.cursor()
query = ("SELECT * FROM temp")
cursor.execute(query)
for (a, b) in cursor:
	api.update_status('#'+a+b)
cursor.close()
cnx.close()
