Changed everything to ASCII. I'm worried we'll lose the forest for the \u1f332
authorTommy Guy <richardtguy84@gmail.com>
Mon, 10 Nov 2014 04:16:36 +0000 (20:16 -0800)
committerTommy Guy <richardtguy84@gmail.com>
Mon, 17 Nov 2014 04:21:49 +0000 (20:21 -0800)
tweepy/models.py
twitter-stream1.py
twitter-stream2.py
twitter1.py
twitter2.py
twitter3.py
twitter4.py
twitter_authentication.py

index 1338ab4..9b70070 100644 (file)
@@ -69,6 +69,11 @@ class Status(Model):
     def parse(cls, api, json):
         status = cls(api)
         for k, v in json.items():
+            
+            # Hack by guyrt to fix unicode issues, which we do *not* want to teach.
+            if isinstance(v, basestring):
+                v = v.encode('ascii', errors='ignore')
+
             if k == 'user':
                 user_model = getattr(api.parser.model_factory, 'user') if api else User
                 user = user_model.parse(api, v)
index 1127d4a..06f7be0 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index 59e0cf2..ce905ea 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index fe0791d..cee5967 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index 44197e6..b00b0f7 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index aced2be..897b7b3 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index b588b1c..26d4027 100644 (file)
@@ -1,7 +1,7 @@
 import tweepy
-from twitter_authentication import API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
+from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
 
-auth = tweepy.OAuthHandler(API_KEY, API_SECRET)
+auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
 
 api = tweepy.API(auth)
index 22655df..141d774 100644 (file)
@@ -1,4 +1,5 @@
-API_KEY = 'CHANGE_ME'
-API_SECRET = 'CHANGE_ME'
+CONSUMER_KEY = 'CHANGE_ME'
+CONSUMER_SECRET = 'CHANGE_ME'
 ACCESS_TOKEN = 'CHANGE_ME'
 ACCESS_TOKEN_SECRET = 'CHANGE_ME'
+

Benjamin Mako Hill || Want to submit a patch?