Browse files

updated fetch_data to user oath credentials (for gathering training d…

…ata from twitter)
  • Loading branch information...
1 parent f9d847d commit 3e78976244f18f3faf111a90724af110e817ef01 Hilary Mason committed Aug 31, 2010
Showing with 4 additions and 5 deletions.
  1. +4 −3 classifiers/fetch_data.py
  2. +0 −2 whitelist_users
View
7 classifiers/fetch_data.py
@@ -2,17 +2,18 @@
import tweepy
from optparse import OptionParser
+sys.path.append('..')
+import settings
-username = 'hmason'
-password = 'twitter7com!'
if __name__ == '__main__':
parser = OptionParser("usage: %prog [options]") # no args this time
# parser.add_option("-d", "--debug", dest="debug", action="store_true", default=False, help="set debug mode = True")
parser.add_option("-q", "--query", dest="query", action="store", help="query")
(options, args) = parser.parse_args()
- auth = tweepy.BasicAuthHandler(username, password)
+ auth = tweepy.OAuthHandler(settings.CONSUMER_KEY, settings.CONSUMER_SECRET)
+ auth.set_access_token(settings.ACCESS_KEY, settings.ACCESS_SECRET)
api = tweepy.API(auth)
for t in api.search(options.query, lang='en', rpp=100):
View
2 whitelist_users
@@ -1,2 +0,0 @@
-twitter_username
-twitter_username

0 comments on commit 3e78976

Please sign in to comment.