Last active
July 6, 2022 04:58
-
-
Save nyanshell/d0a2d6b8789c418ab080ac531e33342e to your computer and use it in GitHub Desktop.
twitter-ak-keepalive
This file contains 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
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() |
This file contains 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
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