Exemple #1
0
    def add_tweets(self, user, party):
        """
        Downloads tweets from a single Twitter user up to the specified ID.

        :param user: the Twitter handle of the user.
        :param party: the political party to which `user` belongs.
        :return the list of downloaded tweets.
        """

        query = Query(**self.oauth)
        tweets = query.get_user_timeline(
            screen_name=user,
            count=200,
            exclude_replies='false',
            include_rts='true')
        self.tweets[user] = tweets
        self.save()
        self.users[user] = party
        return tweets