mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
feat: add sse comvetable (#2888)
This commit is contained in:
@@ -855,6 +855,12 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
<Route author="DIYgod" example="/shanbay/checkin/ddwej" path="/shanbay/checkin/:id" :paramsDesc="['用户 id']" />
|
||||
|
||||
## 上证债券信息网
|
||||
|
||||
### 可转换公司债券公告
|
||||
|
||||
<Route author="kt286" example="/sse/convert/beginDate=2018-08-18&endDate=2019-08-18&companyCode=603283&title=股份" path="/sse/convert/:query?" :paramsDesc="['筛选条件,见示例']"/>
|
||||
|
||||
## 少数派 sspai
|
||||
|
||||
### 最新上架付费专栏
|
||||
|
||||
@@ -1634,4 +1634,7 @@ router.get('/queshu/book/:bookid', require('./routes/queshu/book'));
|
||||
// LaTeX 开源小屋
|
||||
router.get('/latexstudio/home', require('./routes/latexstudio/home'));
|
||||
|
||||
// 上证债券信息网 - 可转换公司债券公告
|
||||
router.get('/sse/convert/:query?', require('./routes/sse/convert'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
32
lib/routes/sse/convert.js
Normal file
32
lib/routes/sse/convert.js
Normal file
@@ -0,0 +1,32 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const query = ctx.params.query || ''; // beginDate=2018-08-18&endDate=2019-08-18&companyCode=603283&title=股份
|
||||
const pageUrl = 'http://bond.sse.com.cn/disclosure/announ/convertible/#';
|
||||
const host = `http://www.sse.com.cn`;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `http://query.sse.com.cn/infodisplay/queryBulletinKzzTipsNew.do?isPagination=true&pageHelp.pageSize=2&flag=0&_=${new Date().getTime()}&${query.replace(/([\u4e00-\u9fa5])/g, (str) => encodeURIComponent(str))}`,
|
||||
headers: {
|
||||
Referer: pageUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const items = response.data.result.map((item) => {
|
||||
const single = {
|
||||
title: item.title,
|
||||
description: `${host}${item.URL}`,
|
||||
pubDate: new Date(item.SSEDate).toUTCString(),
|
||||
link: `${host}${item.URL}`,
|
||||
author: item.security_Code,
|
||||
};
|
||||
return single;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: '上证债券信息网 - 可转换公司债券公告',
|
||||
link: pageUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user