Created
May 16, 2022 08:31
-
-
Save ahmedbesbes/f8039da7319f91dc7e9e8eb9aa66a15a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 tweepy | |
from dotenv import load_dotenv | |
consumer_key = os.environ["API_KEY"] | |
consumer_secret = os.environ["API_KEY_SECRET"] | |
access_token = os.environ["ACCESS_TOKEN"] | |
access_token_secret = os.environ["ACCESS_TOKEN_SECRET"] | |
auth = tweepy.OAuth1UserHandler( | |
consumer_key, | |
consumer_secret, | |
access_token, | |
access_token_secret | |
) | |
api = tweepy.API(auth) | |
extracted_tweets = [] | |
for status in tweepy.Cursor(api.search_tweets, | |
"Ukraine", | |
lang="en", | |
count=100).items(250): | |
extracted_tweets.append(status) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment