def get_save_home(account, auth=None): tweets = get_home(account, auth) for tweet in tweets: if not len(db.get_tweets(tweet_id=tweet.id, account=account)): db.add_tweet(account, tweet) return tweets
def db_load_timeline(self, limit=20): tweets = db.get_tweets(account=self.account) tweets.sort(key=lambda x: x.created_at, reverse=True) if limit and len(tweets) > limit: tweets = tweets[:(limit - 1)] self.update(tweets)
def get_save_home( account, auth = None ): tweets = get_home( account, auth ) for tweet in tweets: if not len( db.get_tweets( tweet_id = tweet.id, account = account ) ): db.add_tweet( account, tweet ) return tweets
def db_load_timeline( self, limit = 20 ): tweets = db.get_tweets( account = self.account ) tweets.sort( key = lambda x: x.created_at, reverse = True ) if limit and len( tweets ) > limit: tweets = tweets[:( limit - 1 )] self.update( tweets )