mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-19 15:09:37 +00:00
add param support
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from flask import Blueprint, render_template, current_app, request
|
||||
|
||||
from flask import Blueprint, render_template, request
|
||||
|
||||
bp = Blueprint('main', __name__)
|
||||
|
||||
@@ -9,12 +8,6 @@ def index():
|
||||
return render_template('main/index.html')
|
||||
|
||||
|
||||
@bp.route('/feeds')
|
||||
def feeds():
|
||||
feed_rules = [rule for rule in current_app.url_map._rules if 'main' in rule.endpoint][:-2]
|
||||
return render_template('main/feeds.html', rules=feed_rules)
|
||||
|
||||
|
||||
@bp.app_template_global()
|
||||
def filter_content(ctx):
|
||||
include_title = request.args.get('include_title')
|
||||
@@ -34,13 +27,8 @@ def filter_content(ctx):
|
||||
|
||||
|
||||
#---------- feed路由从这里开始 -----------#
|
||||
@bp.route('/guokr/scentific')
|
||||
def guokr_scientific():
|
||||
from rsshub.spiders.guokr.scientific import ctx
|
||||
return render_template('main/atom.xml', **filter_content(ctx))
|
||||
|
||||
|
||||
@bp.route('/toutiao/today')
|
||||
def toutiao_today():
|
||||
from rsshub.spiders.toutiao.today import ctx
|
||||
return render_template('main/atom.xml', **filter_content(ctx))
|
||||
@bp.route('/chuansongme/articles/<string:category>')
|
||||
@bp.route('/chuansongme/articles')
|
||||
def chuansongme_articles(category=''):
|
||||
from rsshub.spiders.chuansongme.articles import ctx
|
||||
return render_template('main/atom.xml', **filter_content(ctx(category)))
|
||||
|
||||
Reference in New Issue
Block a user