Пример #1
0
def tweets(page_no):
    if page_no == 1:
        skip = 0
    else:
        if page_no > 1:
            skip = page_no * 24
        else:
            return render_template('error.html', msg=msg)
    tweets = get_all_tweets(limit=25, skip=skip)
    total_tweets = get_total_tweets()
    if total_tweets % 25 :
        total = (total_tweets /25 ) + 1
    else:
        total = total_tweets / 25
    return render_template('tweets.html', tweets = tweets, total = total, \
                            page_no = page_no)
Пример #2
0
def total():
    return jsonify(total = get_total_tweets())