예제 #1
0
def get_sub_entries(sub_id):
    subs = nest_subs(get_subscriptions())
    sub = [sub for sub in subs if sub['id'] == sub_id]
    if len(sub) == 0:
        abort(400)
    sub_entries, sub_titles = get_single_blog(sub[0]['url'])
    return jsonify({'subscription': sub[0]},{'entries': sub_entries})
예제 #2
0
def get_sub(sub_id):
    subs = nest_subs(get_subscriptions())
    sub = [sub for sub in subs if sub['id'] == sub_id]
    if len(sub) == 0:
        abort(400)
    return jsonify({'subscription': sub[0]})
예제 #3
0
def get_subs():
    subs = nest_subs(get_subscriptions())
    return jsonify({'subscriptions': subs})
예제 #4
0
def api():
    ''' Grabs the list of subscriptions and renders them to this page'''
    subs = nest_subs(get_subscriptions())
    print(subs)
    page_title = 'API Endpoints'
    return render_template('api.html', subs=subs, page_title=page_title)
예제 #5
0
def subscriptions():
    ''' Grabs the list of subscriptions and renders them to this page'''
    subs = get_subscriptions()
    page_title = 'All Subscriptions'
    return render_template('subs.html', subs=subs, page_title=page_title)
예제 #6
0
def subscriptions():
    ''' Grabs the list of subscriptions and renders them to this page'''
    subs = get_subscriptions()
    page_title = 'All Subscriptions'
    return render_template('subs.html', subs=subs, page_title=page_title)