-
-
Save thezakman/35c4230e37e2551d08550299075dbdc4 to your computer and use it in GitHub Desktop.
hashtag2-defapi
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
# Query | |
query = "SuperLeague OR #SuperLeague -filter:retweets" | |
def collect_tweets(query, max_id=None, nitems=100, until=None, result_type='recent'): | |
if until is not None: | |
tweets = tweepy.Cursor(api.search, | |
q=query, | |
lang="en", | |
tweet_mode="extended", | |
result_type=result_type, | |
timezone='Europe/England', | |
until=until | |
).items(nitems) | |
else: | |
tweets = tweepy.Cursor(api.search, | |
q=query, | |
lang="en", | |
tweet_mode="extended", | |
result_type=result_type, | |
timezone='Europe/England', | |
max_id=max_id | |
).items(nitems) | |
return tweets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment