]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/oauth.py
Add oauth_callback=oob to force PIN to appear
[z_archive/twitter.git] / twitter / oauth.py
index e36b04512225aa2ad30158e62f4b3afb64f5bb0c..dcc062c79100fa328b4d642fe45a637a2a2685b7 100644 (file)
@@ -22,6 +22,8 @@ strings in the file. Not terribly exciting.
 Finally, you can use the OAuth authenticator to connect to Twitter. In
 code it all goes like this::
 
+    from twitter import *
+
     MY_TWITTER_CREDS = os.path.expanduser('~/.my_app_credentials')
     if not os.path.exists(MY_TWITTER_CREDS):
         oauth_dance("My App Name", CONSUMER_KEY, CONSUMER_SECRET,
@@ -128,9 +130,9 @@ def urlencode_noplus(query):
         TILDE = '____TILDE-PYTHON-TWITTER____'
         for k,v in query:
             if type(k) is unicode: k = k.encode('utf-8')
-            k = k.replace("~", TILDE)
+            k = str(k).replace("~", TILDE)
             if type(v) is unicode: v = v.encode('utf-8')
-            v = v.replace("~", TILDE)
+            v = str(v).replace("~", TILDE)
             new_query.append((k, v))
         query = new_query
         return urlencode(query).replace(TILDE, "~").replace("+", "%20")