Created
May 17, 2020 17:01
-
-
Save PierreRochard/c8444b41307a413ad5c552501ba5198e to your computer and use it in GitHub Desktop.
Twython auth flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twython import Twython | |
api_key = input('Enter the API key: ') | |
print('\n') | |
api_secret = input('Enter the API secret: ') | |
print('\n') | |
twitter = Twython(api_key, api_secret) | |
auth = twitter.get_authentication_tokens() | |
print(auth['auth_url']) | |
oauth_verifier = input('Enter your pin: ') | |
print('\n') | |
twitter = Twython(api_key, | |
api_secret, | |
auth['oauth_token'], | |
auth['oauth_token_secret']) | |
final_step = twitter.get_authorized_tokens(oauth_verifier) | |
print(f"BITCOIN_CONFIRMS_TWITTER_APP_KEY={auth['oauth_token']}") | |
print(f"BITCOIN_CONFIRMS_TWITTER_APP_SECRET={auth['oauth_token_secret']}") | |
print(f"BITCOIN_CONFIRMS_TWITTER_OAUTH_TOKEN={final_step['oauth_token']}") | |
print(f"BITCOIN_CONFIRMS_TWITTER_OAUTH_TOKEN_SECRET={final_step['oauth_token_secret']}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment