mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): 新增 百度股市通 (#10816)
* feat(route): 添加 百度股市通 * fix: 修改 百度股市通 路径 * docs: 添加 百度股市通 文档 * feat: 添加 radar 支持 * fix: 按字母顺序插入新路由
This commit is contained in:
@@ -158,6 +158,12 @@ TokenInsight 官方亦有提供 RSS,可参考 <https://api.tokeninsight.com/re
|
||||
|
||||
</Route>
|
||||
|
||||
## 百度股市通
|
||||
|
||||
### 首页指数
|
||||
|
||||
<Route author="CaoMeiYouRen" example="/baidu/gushitong/index" path="/baidu/gushitong/index"></Route>
|
||||
|
||||
## 北京证券交易所
|
||||
|
||||
### 栏目
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
const got = require('@/utils/got');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
const STATUS_MAP = {
|
||||
up: '上涨',
|
||||
down: '下跌',
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got('https://finance.pae.baidu.com/api/indexbanner?market=ab&finClientType=pc');
|
||||
const item = response.data.Result.map((e) => ({
|
||||
title: e.name,
|
||||
description: art(path.join(__dirname, '../templates/gushitong.art'), {
|
||||
...e,
|
||||
status: STATUS_MAP[e.status],
|
||||
market: e.market.toUpperCase(),
|
||||
}),
|
||||
link: `https://gushitong.baidu.com/index/${e.market}-${e.code}`,
|
||||
}));
|
||||
ctx.state.data = {
|
||||
title: '百度股市通',
|
||||
description:
|
||||
'百度股市通,汇聚全球金融市场的股票、基金、外汇、期货等实时行情,7*24小时覆盖专业财经资讯,提供客观、准确、及时、全面的沪深港美上市公司股价、财务、股东、分红等信息,让用户在复杂的金融市场,更简单的获取投资信息。',
|
||||
link: 'https://gushitong.baidu.com/',
|
||||
item,
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
'/gushitong/index': ['CaoMeiYouRen'],
|
||||
'/tieba/forum/:kw': ['u3u'],
|
||||
'/tieba/forum/good/:kw/:cid?': ['u3u'],
|
||||
'/tieba/post/:id': ['u3u'],
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
module.exports = {
|
||||
'baidu.com': {
|
||||
_name: '贴吧',
|
||||
_name: '百度',
|
||||
gushitong: [
|
||||
{
|
||||
title: '首页指数',
|
||||
docs: 'https://docs.rsshub.app/finance.html#bai-du-gu-shi-tong',
|
||||
source: ['/'],
|
||||
target: '/gushitong/index',
|
||||
},
|
||||
],
|
||||
tieba: [
|
||||
{
|
||||
title: '帖子列表',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = (router) => {
|
||||
router.get('/gushitong/index', require('./gushitong'));
|
||||
router.get('/tieba/forum/:kw', require('./tieba/forum'));
|
||||
router.get('/tieba/forum/good/:kw/:cid?', require('./tieba/forum'));
|
||||
router.get('/tieba/post/:id', require('./tieba/post'));
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<p>
|
||||
市场:{{ market }}<br>
|
||||
代码:{{ code }}<br>
|
||||
名称:{{ name }}<br>
|
||||
收盘价:{{ price }}<br>
|
||||
涨跌幅:{{ ratio }}<br>
|
||||
涨跌额:{{ increase }}<br>
|
||||
走势:{{ status }}<br>
|
||||
</p>
|
||||
Reference in New Issue
Block a user