def getText(self, user_id):
        # first check if the user is marked as an exception
        if self.isExceptionHappened(user_id):
            return []

        # otherwise crawl
        w = CrawlWorker(self.token_queue)
        tweets = w.getStatusMany(user_id, crawl_count = self.n_page)
        if not tweets:  # if tweets are empty, it means some exception occurred
            self.handleException(user_id)

        return tweets
    def getFollowing(self, user_id):
        # first check if the user is marked as an exception
        if self.isExceptionHappened(user_id):
            return []

        # otherwise crawl
        w = CrawlWorker(self.token_queue)
        following = w.getFollowing(user_id)
        if not following:  # if tweets are empty, it means some exception occurred
            self.handleException(user_id)

        return following
 def getFollowing(self, user_id):
     w = CrawlWorker(self.token_queue)
     following_t = w.getFollowing(user_id = user_id)
     return user_id, following_t
Exemple #4
0
 def getText(self, user_id):
     w = CrawlWorker(self.token_queue)
     tweets = w.getStatusMany(user_id, self.crawl_count)
     return tweets
 def getText(self, user_id):
     w = CrawlWorker(self.token_queue)
     tweets = w.getStatus(user_id)
     return tweets