'Fetch tweets from twitter account `account`.'

def get_tweets(self, account, number=MAX_TWEETS, since_id=None, max_id=None):

    import twitter
    all_tweets = []
    while (number > 0):
        try:
            tweets = self.api.GetUserTimeline(screen_name=account, include_rts=False, exclude_replies=True, count=min(number, CHUNK_SIZE), since_id=since_id, max_id=max_id)
        except twitter.TwitterError as e:
            raise plugin.PluginError((u'Unable    to    fetch    timeline    %s    for    %s' % (account, e)))
        if (not tweets):
            break
        all_tweets += tweets
        number -= len(tweets)
        max_id = (tweets[(-1)].id - 1)
    return all_tweets
