]> jfr.im git - z_archive/twitter.git/blobdiff - twitter/oauth_dance.py
Add oauth_callback=oob to force PIN to appear
[z_archive/twitter.git] / twitter / oauth_dance.py
index 1e398496cabbd55d6038e8cf7ca63af1bff184ad..1d005a86a7f257189905147e4a4241fed88ba99c 100644 (file)
@@ -2,7 +2,6 @@ from __future__ import print_function
 
 import webbrowser
 import time
-import json
 
 from .api import Twitter, json
 from .oauth import OAuth, write_token_file
@@ -50,7 +49,7 @@ def oauth_dance(app_name, consumer_key, consumer_secret, token_filename=None):
         auth=OAuth('', '', consumer_key, consumer_secret),
         format='', api_version=None)
     oauth_token, oauth_token_secret = parse_oauth_tokens(
-        twitter.oauth.request_token())
+        twitter.oauth.request_token(oauth_callback="oob"))
     print("""
 In the web browser window that opens please choose to Allow
 access. Copy the PIN number that appears on the next page and paste or