diff --git a/rsshub/blueprints/main.py b/rsshub/blueprints/main.py index 34305e6..0301e26 100644 --- a/rsshub/blueprints/main.py +++ b/rsshub/blueprints/main.py @@ -193,4 +193,9 @@ def mp_gh(gh=''): @bp.route('/mp/youwuqiong/') def mp_youwuqiong(author=''): from rsshub.spiders.mp.youwuqiong import ctx - return render_template('main/atom.xml', **filter_content(ctx(author))) \ No newline at end of file + return render_template('main/atom.xml', **filter_content(ctx(author))) + +@bp.route('/yfchuhai/express/') +def yfchuhai_express(): + from rsshub.spiders.yfchuhai.express import ctx + return render_template('main/atom.xml', **filter_content(ctx())) \ No newline at end of file diff --git a/rsshub/spiders/yfchuhai/express.py b/rsshub/spiders/yfchuhai/express.py new file mode 100644 index 0000000..95b6e1b --- /dev/null +++ b/rsshub/spiders/yfchuhai/express.py @@ -0,0 +1,29 @@ +import requests +from rsshub.utils import DEFAULT_HEADERS + +domain = 'https://www.yfchuhai.com' + + +def parse(post): + item = {} + item['title'] = post['title'] + item['description'] = post['content'] + item['link'] = f"https://www.yfchuhai.com/news/{post['id']}.html" + #item['pubDate'] = post['createTime'] + item['author'] = post['source'] + return item + + +def ctx(category=''): + DEFAULT_HEADERS.update({'Referer': 'https://www.yfchuhai.com/news/'}) + r_url = f'{domain}/api/News/getList' + print(r_url) + posts = requests.get(r_url, headers=DEFAULT_HEADERS).json()['data']['list'] + user_name = posts[0] + return { + 'title': '快讯 - 扬帆出海', + 'link': 'https://www.yfchuhai.com/news/', + 'description': '快讯 - 扬帆出海', + 'author': 'hillerliao', + 'items': list(map(parse, posts)) + } \ No newline at end of file diff --git a/rsshub/templates/main/feeds.html b/rsshub/templates/main/feeds.html index 96d7d8a..ec0e97c 100644 --- a/rsshub/templates/main/feeds.html +++ b/rsshub/templates/main/feeds.html @@ -243,6 +243,18 @@
+ +
+
+

扬帆出海-快讯

+
扬帆出海-快讯 by hillerliao
+

举例:https://pyrsshub.herokuapp.com/yfchuhai/express/

+

路由:/yfchuhai/express/

+
+
+
+ +