cfoltran / projectHone

MIT License
1 stars 2 forks source link

Python : gérer plusieurs hashtags pour les statistiques de la carte #23

Closed Minstery closed 6 years ago

Minstery commented 6 years ago
def defaultSearch ()
    arrayHashtags=["#jeuxolympiques2018", "#JO2018@", "#JO", "#espritbleu", #pyeongchang2018"]
    arrayTweets=[]

    for hashtag in arrayHashtags
        #Here, do a for in the last 12h tweets instead of this loop (function by Othmane)
        for tweet in tweepy.Cursor(api.search, q=hashtag,count=100, lang="fr", since="2018-02-019").items():
            #We store the tweet in a tweet object (function by Alexandre)
            arrayTweets.append(Tweet(tweet.text,tweet.author,tweet.created_at,tweet.location))

    #We return the array with all the tweets so that they can be analized by Antoine's function
    return arrayTweets