Skip to content

Instantly share code, notes, and snippets.

@nyanshell
Last active July 6, 2022 04:58
Show Gist options
  • Save nyanshell/d0a2d6b8789c418ab080ac531e33342e to your computer and use it in GitHub Desktop.
Save nyanshell/d0a2d6b8789c418ab080ac531e33342e to your computer and use it in GitHub Desktop.
twitter-ak-keepalive
import os
from requests_oauthlib import OAuth1Session
API_KEY = os.getenv('API_KEY')
API_SECRET = os.getenv('API_SECRET')
def keep_alive():
oauth = OAuth1Session(client_key, client_secret=client_secret)
user_info = oauth.get('https://api.twitter.com/1.1/users/show.json', params={'screen_name': 'twitter'})
if __name__ == '__main__':
keep_alive()
oauthlib==3.2.0
requests-oauthlib==1.3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment