def timeline(ctx, pager, limit): """Retrieve your personal timeline.""" sources = ctx.obj['conf'].following tweets = get_tweets(sources, limit) if pager: click.echo_via_pager("\n\n".join( (style_tweet(tweet) for tweet in tweets))) else: click.echo() for tweet in tweets: click.echo(style_tweet(tweet)) click.echo()
def timeline(ctx, pager, limit, twtfile): """Retrieve your personal timeline.""" sources = ctx.obj["conf"].following tweets = get_remote_tweets(sources, limit) if twtfile: source = Source(ctx.obj["conf"].nick, file=twtfile) tweets.extend(get_local_tweets(source, limit)) tweets = sorted(tweets, reverse=True)[:limit] if not tweets: return if pager: click.echo_via_pager("\n\n".join( (style_tweet(tweet) for tweet in tweets))) else: click.echo() for tweet in tweets: click.echo(style_tweet(tweet)) click.echo()
def timeline(ctx, pager, limit, twtfile, sorting, timeout): """Retrieve your personal timeline.""" sources = ctx.obj["conf"].following tweets = get_remote_tweets(sources, limit, timeout) if twtfile: source = Source(ctx.obj["conf"].nick, file=twtfile) tweets.extend(get_local_tweets(source, limit)) tweets = sort_and_truncate_tweets(tweets, sorting, limit) if not tweets: return if pager: click.echo_via_pager("\n\n".join( (style_tweet(tweet) for tweet in tweets))) else: click.echo() for tweet in tweets: click.echo(style_tweet(tweet)) click.echo()