Exemplo n.º 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})
Exemplo n.º 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]})
Exemplo n.º 3
0
def get_subs():
    subs = nest_subs(get_subscriptions())
    return jsonify({'subscriptions': subs})
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)