Skip to content

Instantly share code, notes, and snippets.

@edsu
Created September 29, 2021 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/97712b965b3c1e1a8413bd83922b4ac4 to your computer and use it in GitHub Desktop.
Save edsu/97712b965b3c1e1a8413bd83922b4ac4 to your computer and use it in GitHub Desktop.
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