mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-16 11:37:44 +08:00
add 惠誉评级板块 (#1457)
This commit is contained in:
@@ -2824,6 +2824,10 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看
|
||||
|
||||
<route name="最新政策" author="SettingDust" example="/gov/zhengce/zuixin" path="/gov/zhengce/zuixin"/>
|
||||
|
||||
### 惠誉评级
|
||||
|
||||
<route name="板块信息" author="LogicJake" example="/fitchratings/site/economics" path="/fitchratings/site/:type" :paramsDesc="['板块名称,在网址site后面']"/>
|
||||
|
||||
### 移动支付网
|
||||
|
||||
<route name="新闻" author="LogicJake" example="/mpaypass/news" path="/mpaypass/news"/>
|
||||
|
||||
@@ -1006,6 +1006,10 @@ router.get('/gov/zhengce/zuixin', require('./routes/gov/zhengce/zuixin'));
|
||||
// 小黑盒
|
||||
router.get('/xiaoheihe/user/:id', require('./routes/xiaoheihe/user'));
|
||||
|
||||
// 惠誉评级
|
||||
router.get('/fitchratings/site/:type', require('./routes/fitchratings/site'));
|
||||
|
||||
// 移动支付
|
||||
router.get('/mpaypass/news', require('./routes/mpaypass/news'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
33
lib/routes/fitchratings/site.js
Normal file
33
lib/routes/fitchratings/site.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type;
|
||||
|
||||
const link = `https://www.fitchratings.com/site/${type}`;
|
||||
const listData = await axios.get(link);
|
||||
const $list = cheerio.load(listData.data);
|
||||
ctx.state.data = {
|
||||
title: `${type} - 惠誉评级`,
|
||||
link,
|
||||
item: await Promise.all(
|
||||
$list('div.card-text-container')
|
||||
.slice(0, 10)
|
||||
.map(async (_, el) => {
|
||||
const $el = $list(el);
|
||||
const $a = $el.find('h4 a');
|
||||
|
||||
const href = $a.attr('href');
|
||||
const title = $a.text();
|
||||
const description = $el.find('div p').text();
|
||||
|
||||
return {
|
||||
title: title,
|
||||
description,
|
||||
link: href,
|
||||
};
|
||||
})
|
||||
.get()
|
||||
),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user