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