feat(route): add BigQuant专题报告 (#9253)

This commit is contained in:
Ethan Shen
2022-03-08 21:52:16 +08:00
committed by GitHub
parent 007948efcd
commit 2f01aa6819
5 changed files with 60 additions and 0 deletions
+6
View File
@@ -4,6 +4,12 @@ pageClass: routes
# 金融
## BigQuant
### 专题报告
<Route author="nczitzk" example="/bigquant/collections" path="/bigquant/collections"/>
## CFD
### 每周股指派息调整 (GBP)
+35
View File
@@ -0,0 +1,35 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const md = require('markdown-it')({
html: true,
});
module.exports = async (ctx) => {
const rootUrl = 'https://bigquant.com';
const currentUrl = `${rootUrl}/wiki/api/documents.list`;
const response = await got({
method: 'post',
url: currentUrl,
json: {
collectionId: 'c6874e5d-7f45-4e90-8cd9-5e43df3b44ef',
direction: 'DESC',
limit: 25,
offset: 0,
sort: 'publishedAt',
},
});
const items = response.data.data.map((item) => ({
title: item.title,
link: `${rootUrl}/wiki${item.url}`,
description: md.render(item.text),
pubDate: parseDate(item.publishedAt),
}));
ctx.state.data = {
title: '专题报告 - AI量化知识库 - BigQuant',
link: `${rootUrl}/wiki/collections/c6874e5d-7f45-4e90-8cd9-5e43df3b44ef`,
item: items,
};
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/collections': ['nczitzk'],
};
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
'bigquant.com': {
_name: 'BigQuant',
'.': [
{
title: '专题报告',
docs: 'https://docs.rsshub.app/finance.html#bigquant-zhuan-ti-bao-gao',
source: '/',
target: '/bigquant/collections',
},
],
},
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/collections', require('./collections'));
};