Skip to content

Instantly share code, notes, and snippets.

@0xDispatch
Created February 7, 2023 09:49
Show Gist options
  • Save 0xDispatch/8ea8f1cea701c7209c2579a8a7608380 to your computer and use it in GitHub Desktop.
Save 0xDispatch/8ea8f1cea701c7209c2579a8a7608380 to your computer and use it in GitHub Desktop.
a simple python script to generate Access tokens using twitter official keys.
import requests
from requests_oauthlib import OAuth1
#twitter official keys *Twitter for Android*
consumer_key = "3nVuSoBZnx6U4vzUxf5w"
consumer_secret = "Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys"
#change these to your user&pass
username = "NordsWarrior"
password = "NeverGonnaGiveYouUp"
oauth = OAuth1(
consumer_key,client_secret=consumer_secret
)
r = requests.post(
url="https://api.twitter.com/oauth/access_token",
auth=oauth,
data={
'x_auth_mode': 'client_auth',
'x_auth_username': username,
'x_auth_password': password})
print(r.content)
@0xDispatch
Copy link
Author

these keys work as well.

#Twitter for Mac
consumer_key = "3rJOl1ODzm9yZy63FACdg"
consumer_secret = "5jPoQ5kQvMJFDYRNE8bQ4rHuds4xJqhvgNJM4awaE8"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment