fix(route): csrc (#11996)
This commit is contained in:
parent
eb5e1f39ac
commit
1474949bee
|
|
@ -1216,17 +1216,21 @@ pageClass: routes
|
|||
|
||||
## 中国证券监督管理委员会
|
||||
|
||||
### 发审委公告
|
||||
### 通用
|
||||
|
||||
<Route author="chinobing" example="/csrc/fashenwei" path="/csrc/fashenwei"/>
|
||||
<Route author="chinobing LogicJake" example="/gov/csrc/news/c101975/zfxxgk_zdgk.shtml" path="/gov/csrc/news/:suffix*" :paramsDesc="['路径,预设为 `c100028/common_xq_list.shtml`']" radar="1">
|
||||
|
||||
### 证监会消息
|
||||
::: tip 提示
|
||||
路径处填写对应页面 URL 中 `http://www.csrc.gov.cn/csrc/` 后的字段。下面是一个例子。
|
||||
|
||||
<Route author="chinobing LogicJake" example="/csrc/news/zjhxwfb-xwfbh" path="/csrc/news/:suffix?" :paramsDesc="['支持形如 `http://www.csrc.gov.cn/pub/newsite/*/*` 的网站,将 newsite 后面的两段网址后缀以 - 连接']" />
|
||||
若订阅 [证监会要闻](http://www.csrc.gov.cn/csrc/c100028/common_xq_list.shtml) 则将对应页面 URL <http://www.csrc.gov.cn/csrc/c100028/common_xq_list.shtml> 中 `http://www.csrc.gov.cn/csrc/` 后的字段 `c100028/common_xq_list.shtml` 作为路径填入。此时路由为 [`/gov/csrc/news/c100028/common_xq_list.shtml`](https://rsshub.app/gov/csrc/news/c100028/common_xq_list.shtml)
|
||||
:::
|
||||
|
||||
</Route>
|
||||
|
||||
### 申请事项进度
|
||||
|
||||
<Route author="hillerliao" example="/csrc/auditstatus/:apply_id" path="/csrc/auditstatus" :paramsDesc="['事项类别id,`https://neris.csrc.gov.cn/alappl/home/xkDetail` 列表中各地址的 appMatrCde 参数']"/>
|
||||
<Route author="hillerliao" example="/gov/csrc/auditstatus/9ce91cf2d750ee62de27fbbcb05fa483" path="/gov/csrc/auditstatus/:apply_id" :paramsDesc="['事项类别id,`https://neris.csrc.gov.cn/alappl/home/xkDetail` 列表中各地址的 appMatrCde 参数']" radar="1"/>
|
||||
|
||||
## 中国政府网
|
||||
|
||||
|
|
|
|||
|
|
@ -1754,9 +1754,9 @@ router.get('/8btc/news/flash', lazyloadRouteHandler('./routes/8btc/news/flash'))
|
|||
router.get('/vuevideo/:userid', lazyloadRouteHandler('./routes/vuevideo/user'));
|
||||
|
||||
// 证监会
|
||||
router.get('/csrc/news/:suffix?', lazyloadRouteHandler('./routes/csrc/news'));
|
||||
router.get('/csrc/fashenwei', lazyloadRouteHandler('./routes/csrc/fashenwei'));
|
||||
router.get('/csrc/auditstatus/:apply_id', lazyloadRouteHandler('./routes/csrc/auditstatus'));
|
||||
// router.get('/csrc/news/:suffix?', lazyloadRouteHandler('./routes/csrc/news'));
|
||||
// router.get('/csrc/fashenwei', lazyloadRouteHandler('./routes/csrc/fashenwei'));
|
||||
// router.get('/csrc/auditstatus/:apply_id', lazyloadRouteHandler('./routes/csrc/auditstatus'));
|
||||
|
||||
// LWN.net Alerts
|
||||
router.get('/lwn/alerts/:distributor', lazyloadRouteHandler('./routes/lwn/alerts'));
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const apply_id = ctx.params.apply_id;
|
||||
const userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1';
|
||||
const item_url = `https://neris.csrc.gov.cn/alappl/home1/onlinealog?appMatrCde=${apply_id}`;
|
||||
const url = 'https://neris.csrc.gov.cn/alappl/home1/onlinealog.do';
|
||||
const res = await got({
|
||||
// method: 'get',
|
||||
method: 'post',
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': userAgent,
|
||||
},
|
||||
form: {
|
||||
appMatrCde: apply_id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
const $ = cheerio.load(res.data);
|
||||
const list = $('tr[height=50]').get();
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map((item) => {
|
||||
const $ = cheerio.load(item);
|
||||
const audit_status_td = $('td[style="font-weight:100 ;color: black ;position: relative;left:20px"]');
|
||||
const audit_status = audit_status_td.eq(-1).text();
|
||||
const title = '【' + audit_status + '】' + $('li.templateTip').text();
|
||||
const audit_date = audit_status_td.eq(-1).next('td').text();
|
||||
|
||||
let audit_desc = '';
|
||||
if (audit_status_td.length > 1) {
|
||||
for (let i = 0; i < audit_status_td.length; i++) {
|
||||
audit_desc += audit_status_td.eq(i).next('td').text() + ',' + audit_status_td.eq(i).text() + ';';
|
||||
}
|
||||
} else {
|
||||
audit_desc = audit_date + ',' + audit_status;
|
||||
}
|
||||
|
||||
const description = $('li.templateTip').text() + ':' + audit_desc;
|
||||
const itemUrl = item_url;
|
||||
|
||||
const single = {
|
||||
title,
|
||||
description,
|
||||
pubDate: new Date(audit_date).toUTCString(),
|
||||
link: itemUrl,
|
||||
guid: itemUrl,
|
||||
};
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
ctx.state.data = {
|
||||
title: '申请事项进度查询 - 中国证监会',
|
||||
link: item_url,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const url = 'http://www.csrc.gov.cn/pub/zjhpublic/3300/3621/index_7401.htm';
|
||||
const ori_url = 'http://www.csrc.gov.cn/pub/zjhpublic/';
|
||||
const res = await got.get(url);
|
||||
const $ = cheerio.load(res.data);
|
||||
const list = $('.row').get();
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map(async (item) => {
|
||||
const $ = cheerio.load(item);
|
||||
const time = $('li.fbrq').text();
|
||||
const title = $('li.mc > div').text();
|
||||
const sub_url = $('li.mc > div').find('a').attr('href').slice(6);
|
||||
const itemUrl = ori_url + sub_url;
|
||||
const cache = await ctx.cache.get(itemUrl);
|
||||
if (cache) {
|
||||
return Promise.resolve(JSON.parse(cache));
|
||||
}
|
||||
|
||||
const responses = await got.get(itemUrl);
|
||||
const $d = cheerio.load(responses.data);
|
||||
|
||||
const single = {
|
||||
title,
|
||||
pubDate: new Date(time).toUTCString(),
|
||||
link: itemUrl,
|
||||
guid: itemUrl,
|
||||
description: $d('#ContentRegion .Custom_UnionStyle').html(),
|
||||
};
|
||||
ctx.cache.set(itemUrl, JSON.stringify(single));
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link: url,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
const { resolve } = require('url');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
let suffix = ctx.params.suffix || 'zjhxwfb-xwdd';
|
||||
suffix = suffix.replace('-', '/');
|
||||
const url = resolve('http://www.csrc.gov.cn/pub/newsite/', suffix + '/');
|
||||
const res = await got.get(url);
|
||||
const $ = cheerio.load(res.data);
|
||||
const title = $('div.title .bt').text();
|
||||
const list = $('.fl_list li').get();
|
||||
|
||||
const out = await Promise.all(
|
||||
list.map(async (item) => {
|
||||
const $ = cheerio.load(item);
|
||||
const time = $('span').text();
|
||||
const title = $('a').text();
|
||||
const sub_url = $('a').attr('href');
|
||||
const itemUrl = resolve(url, sub_url);
|
||||
const cache = await ctx.cache.get(itemUrl);
|
||||
if (cache) {
|
||||
return Promise.resolve(JSON.parse(cache));
|
||||
}
|
||||
|
||||
const responses = await got.get(itemUrl);
|
||||
const $d = cheerio.load(responses.data);
|
||||
|
||||
const single = {
|
||||
title,
|
||||
pubDate: new Date(time).toUTCString(),
|
||||
link: itemUrl,
|
||||
guid: itemUrl,
|
||||
description: $d('.content .Custom_UnionStyle').html() || $d('.contentss').html() || $d('.Section0').html(),
|
||||
};
|
||||
ctx.cache.set(itemUrl, JSON.stringify(single));
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
);
|
||||
ctx.state.data = {
|
||||
title: `中国证券监督管理委员会-${title}`,
|
||||
link: url,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const timezone = require('@/utils/timezone');
|
||||
const md5 = require('@/utils/md5');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const baseUrl = 'https://neris.csrc.gov.cn';
|
||||
const { apply_id } = ctx.params;
|
||||
const itemUrl = `${baseUrl}/alappl/home1/onlinealog`;
|
||||
const res = await got(itemUrl, {
|
||||
searchParams: {
|
||||
appMatrCde: apply_id,
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(res.data);
|
||||
|
||||
const out = $('tr[height="50"]')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const itemTitle = item.find('li.templateTip').text();
|
||||
const audit_status_td = item.find('td[style="font-weight:100 ;color: black ;position: relative;left:20px"]');
|
||||
const audit_status = audit_status_td.eq(-1).text();
|
||||
const title = '【' + audit_status + '】' + itemTitle;
|
||||
const audit_date = audit_status_td.eq(-1).next('td').text();
|
||||
|
||||
let audit_desc = '';
|
||||
if (audit_status_td.length > 1) {
|
||||
for (let i = 0; i < audit_status_td.length; i++) {
|
||||
audit_desc += audit_status_td.eq(i).next('td').text() + ',' + audit_status_td.eq(i).text() + ';';
|
||||
}
|
||||
} else {
|
||||
audit_desc = audit_date + ',' + audit_status;
|
||||
}
|
||||
|
||||
const description = itemTitle + ':' + audit_desc;
|
||||
|
||||
const single = {
|
||||
title,
|
||||
description,
|
||||
pubDate: timezone(parseDate(audit_date), 8),
|
||||
link: res.url,
|
||||
guid: `${res.url}#${md5(description)}`,
|
||||
};
|
||||
return single;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${$('.zx2 div').attr('title')} - 申请事项进度查询 - 中国证监会`,
|
||||
link: res.url,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const timezone = require('@/utils/timezone');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const baseUrl = 'http://www.csrc.gov.cn';
|
||||
const { suffix = 'c100028/common_xq_list.shtml' } = ctx.params;
|
||||
const link = `${baseUrl}/csrc/${suffix}`;
|
||||
const { data: res } = await got(link);
|
||||
const $ = cheerio.load(res);
|
||||
|
||||
const channelId = $('meta[name="channelid"]').attr('content');
|
||||
|
||||
let data,
|
||||
out = [];
|
||||
if (channelId) {
|
||||
data = await got(`${baseUrl}/searchList/${channelId}`, {
|
||||
searchParams: {
|
||||
_isAgg: true,
|
||||
_isJson: true,
|
||||
_pageSize: 18,
|
||||
_template: 'index',
|
||||
_rangeTimeGte: '',
|
||||
_channelName: '',
|
||||
page: 1,
|
||||
},
|
||||
});
|
||||
|
||||
out = data.data.data.results.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.contentHtml + art(path.join(__dirname, 'templates', 'attachment.art'), { attachments: item.resList }),
|
||||
pubDate: parseDate(item.publishedTime, 'x'),
|
||||
link: item.url,
|
||||
}));
|
||||
} else {
|
||||
const list = $('#list li')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
const a = item.find('a');
|
||||
return {
|
||||
title: a.text(),
|
||||
link: `${baseUrl}${a.attr('href')}`,
|
||||
pubDate: timezone(parseDate(item.find('.data').text(), 'YYYY-MM-DD'), 8),
|
||||
};
|
||||
});
|
||||
|
||||
out = await Promise.all(
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const { data: res } = await got(item.link);
|
||||
const $ = cheerio.load(res);
|
||||
item.description = $('.detail-news').html();
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
ctx.state.data = {
|
||||
title: `中国证券监督管理委员会 - ${data?.data.channelName || $('head title').text()}`,
|
||||
link,
|
||||
image: 'http://www.csrc.gov.cn/favicon.ico',
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
{{ each attachments a }}
|
||||
<a href="{{ a.filePath.startsWith('/') ? `http://www.csrc.gov.cn${a.filePath}` : a.filePath }}">{{ a.fileName }}</a>
|
||||
{{ /each }}
|
||||
|
|
@ -12,6 +12,8 @@ module.exports = {
|
|||
'/cmse/kpjy/:id': ['nczitzk'],
|
||||
'/cmse/:path+': ['nczitzk'],
|
||||
'/cnnic/:path+': ['nczitzk'],
|
||||
'/csrc/auditstatus/:apply_id': ['hillerliao'],
|
||||
'/csrc/news/:suffix*': ['chinobing', 'LogicJake'],
|
||||
'/customs/list/:gchannel?': ['Jeason0228', 'TonyRL', 'he1q'],
|
||||
'/fmprc/:category?': ['nicolaszf', 'nczitzk'],
|
||||
'/immiau/news': ['liu233w'],
|
||||
|
|
|
|||
|
|
@ -406,6 +406,25 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
'csrc.gov.cn': {
|
||||
_name: '中国证券监督管理委员会',
|
||||
neris: [
|
||||
{
|
||||
title: '申请事项进度',
|
||||
docs: 'https://docs.rsshub.app/government.html#zhong-guo-zheng-quan-jian-du-guan-li-wei-yuan-hui',
|
||||
source: ['/alappl/home1/onlinealog'],
|
||||
target: (_, url) => `/gov/csrc/auditstatus/${new URL(url).searchParams.get('appMatrCde')}`,
|
||||
},
|
||||
],
|
||||
www: [
|
||||
{
|
||||
title: '通用',
|
||||
docs: 'https://docs.rsshub.app/government.html#zhong-guo-zheng-quan-jian-du-guan-li-wei-yuan-hui',
|
||||
source: ['/csrc/*suffix'],
|
||||
target: '/gov/csrc/:suffix',
|
||||
},
|
||||
],
|
||||
},
|
||||
'customs.gov.cn': {
|
||||
_name: '中华人民共和国海关总署',
|
||||
www: [
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ module.exports = function (router) {
|
|||
router.get('/cmse/fxrw', require('./cmse/fxrw'));
|
||||
router.get(/cmse(\/[\w/-]+)?/, require('./cmse'));
|
||||
router.get(/cnnic(\/[\w/-]+)?/, require('./cnnic'));
|
||||
router.get('/csrc/auditstatus/:apply_id', require('./csrc/auditstatus'));
|
||||
router.get('/csrc/news/:suffix*', require('./csrc/news'));
|
||||
router.get('/customs/list/:gchannel?', require('./customs/list'));
|
||||
router.get('/fmprc/:category?', require('./mfa/wjdt'));
|
||||
router.get('/immiau/news', require('./immiau/news'));
|
||||
|
|
|
|||
Loading…
Reference in New Issue