Created
September 29, 2021 12:13
-
-
Save edsu/97712b965b3c1e1a8413bd83922b4ac4 to your computer and use it in GitHub Desktop.
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 | |
import requests_oauthlib | |
e = os.environ.get | |
client = requests_oauthlib.OAuth1Session( | |
client_key=e("CONSUMER_KEY"), | |
client_secret=e("CONSUMER_SECRET"), | |
resource_owner_key=e("ACCESS_TOKEN"), | |
resource_owner_secret=e("ACCESS_TOKEN_SECRET") | |
) | |
response = client.get("https://api.twitter.com/2/tweets/search/recent", params={"query": "obama biden"}) | |
print(response.json()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment