diff --git a/lib/v2/mrm/index.js b/lib/v2/mrm/index.js new file mode 100644 index 0000000000..eef3547418 --- /dev/null +++ b/lib/v2/mrm/index.js @@ -0,0 +1,42 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const { category = 'zonghezixun3' } = ctx.params; + const baseUrl = 'http://www.mrm.com.cn'; + const link = `${baseUrl}/${category}.html`; + + const { data: response } = await got(link); + const $ = cheerio.load(response); + + const list = $('#datalist_wap .li') + .toArray() + .map((item) => { + item = $(item); + const a = item.find('a'); + return { + title: a.text().trim(), + link: `${baseUrl}${a.attr('href')}`, + pubDate: parseDate(item.find('.d').text(), 'YYYY.MM.DD'), + }; + }); + + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data } = await got(item.link); + const $ = cheerio.load(data); + + item.description = $('.article-cont').html(); + return item; + }) + ) + ); + + ctx.state.data = { + title: $('head title').text(), + link, + item: items, + }; +}; diff --git a/lib/v2/mrm/maintainer.js b/lib/v2/mrm/maintainer.js new file mode 100644 index 0000000000..9644afe025 --- /dev/null +++ b/lib/v2/mrm/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:category?': ['TonyRL'], +}; diff --git a/lib/v2/mrm/radar.js b/lib/v2/mrm/radar.js new file mode 100644 index 0000000000..b61df6d6e3 --- /dev/null +++ b/lib/v2/mrm/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'mrm.com.cn': { + _name: '华储网', + '.': [ + { + title: '通知', + docs: 'https://docs.rsshub.app/finance#hua-chu-wang', + source: ['/:category'], + target: (params) => `/mrm/${params.category.replace('.html', '')}`, + }, + ], + }, +}; diff --git a/lib/v2/mrm/router.js b/lib/v2/mrm/router.js new file mode 100644 index 0000000000..9885c36f13 --- /dev/null +++ b/lib/v2/mrm/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:category?', require('./index')); +}; diff --git a/website/docs/routes/finance.mdx b/website/docs/routes/finance.mdx index 2e56442b66..0f527d56d2 100644 --- a/website/docs/routes/finance.mdx +++ b/website/docs/routes/finance.mdx @@ -457,6 +457,16 @@ TokenInsight also provides official RSS, you can take a look at [https://api.tok `http://www.nifd.cn/Research?categoryGuid=7a6a826d-b525-42aa-b550-4236e524227f` 对应 `/nifd/research/7a6a826d-b525-42aa-b550-4236e524227f` +## 华储网 {#hua-chu-wang} + +### 通知 {#hua-chu-wang-tong-zhi} + + + | 交易通知 | 政策规定 | 业务通知 | + | ------------ | -------------------- | ----------------- | + | zonghezixun3 | zhengceguiding\_list | yewutongzhi\_list | + + ## 汇通网 {#hui-tong-wang} ### 7x24 小时快讯 {#hui-tong-wang-7x24-xiao-shi-kuai-xun}