Exemple #1
0
    def get_timeline(self, api, t_name):
        judge = Judge()
        try:

            for tweet in api.user_timeline(id=t_name, count=self.__num):
                #for tweet in api.user_timeline(id = Twitterkey.id, count = self.__num):
                if judge.my_timeline_multi(tweet):
                    try:
                        self.__status_media[self.__count] = tweet
                        self.__count += 1
                    except:
                        pass

                elif judge.my_timeline_single(tweet):
                    try:
                        self.__status_media[self.__count] = tweet
                        self.__count += 1
                    except:
                        pass
        except tp.error.TweepError:
            for _ in tqdm(range(15 * 60)):
                time.sleep(1)

        return self.__status_media