示例#1
0
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
示例#2
0
    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)
示例#3
0
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
示例#4
0
 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 )