Skip to content

Commit

Permalink
Various changes to search.py
Browse files Browse the repository at this point in the history
	Updated it to pull dbconfig from the configuration file
	Fixed a bug where the connection to get auth keys would fail
  • Loading branch information
pattonwebz committed Nov 23, 2015
1 parent 0a531ee commit b8723c1
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,13 @@
import tweepy, sys
import dbconnect
import twitterfunctions
from configuration import dbconfig

## enter database connection information
dbconfig = {
'user': 'bot-twitter',
'password': 'someSecurePassword',
'host': '127.0.0.1',
'database': 'twitterbot',
'raise_on_warnings': True,
}
getKeySecretQuery = ("SELECT CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET FROM Accounts WHERE user = 'default'")

authcnx = dbconnect.dbconnect(dbconfig)
authcursor = dbconnect.dbcursor(authcnx)
authcnx=dbconnect.dbconnect(dbconfig)
authcursor=dbconnect.dbcursor(authcnx)

getKeySecretQuery = ("SELECT CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET FROM Accounts WHERE user = 'default'")
gotKeySecretResult = authcursor.execute(getKeySecretQuery)
KeySecretResult = authcursor.fetchall()

Expand All @@ -28,6 +21,7 @@
THE_CONSUMER_SECRET = CONSUMER_SECRET
THE_ACCESS_KEY = ACCESS_KEY
THE_ACCESS_SECRET = ACCESS_SECRET

api = twitterfunctions.authenticatetwitter(THE_CONSUMER_KEY, THE_CONSUMER_SECRET, THE_ACCESS_KEY, THE_ACCESS_SECRET)


Expand Down

0 comments on commit b8723c1

Please sign in to comment.