diff --git a/twitter-api-example.py b/twitter-api-example.py index 120cc0a1c84b8cafd54e5b270e35866b2585ad9b..c50303266c4cc6eadddf61a03ea3f9f2738db1a9 100755 --- a/twitter-api-example.py +++ b/twitter-api-example.py @@ -11,9 +11,11 @@ import logging logging.basicConfig(level=logging.INFO) def search(api, sincedate, untildate, csvFile, jsonFile): - searchQuery = '((cota OR cotas OR universidade OR universidades) AND (racial OR raciais)) OR ((universidade OR universidades) AND (cota OR cotas))' - maxTweets = 10000000 + ##### You can change here + # Variable with the desireable query. + searchQuery = '' + maxTweets = 10000000 tweetsPerQry = 100 # this is the max the API permits csvWriter = csv.writer(csvFile) @@ -61,8 +63,8 @@ def search(api, sincedate, untildate, csvFile, jsonFile): tweet.lang, tweet.text.encode('utf-8')]) tweetCount += len(new_tweets) - print("Downloaded {0} tweets".format(tweetCount)) - max_id = new_tweets[-1].id + print("Downloaded {0} tweets".format(tweetCount)) + max_id = new_tweets[-1].id except tweepy.TweepError as e: print("some error: " + str(e)) continue