mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
feat(route):add 上海市教育考试院 - 消息速递 (#8714)
Co-authored-by: jialinghui <mail@jialinghui.com>
This commit is contained in:
@@ -726,6 +726,13 @@ type 为 all 时,category 参数不支持 cost 和 free
|
|||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
|
## 上海市教育考试院
|
||||||
|
|
||||||
|
### 消息速递
|
||||||
|
|
||||||
|
官方网址:<http://www.shmeea.edu.cn>
|
||||||
|
|
||||||
|
<Route author="jialinghui" example="/shmeea" path="/shmeea" radar="1" rssbud="1"/>
|
||||||
## 上海证券交易所
|
## 上海证券交易所
|
||||||
|
|
||||||
### 上市公司信息最新公告披露
|
### 上市公司信息最新公告披露
|
||||||
|
|||||||
44
lib/v2/shmeea/index.js
Normal file
44
lib/v2/shmeea/index.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const baseURL = 'http://www.shmeea.edu.cn';
|
||||||
|
const rootUrl = baseURL + '/page/08000/index.html';
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: rootUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
const list = $('#main .pageList li');
|
||||||
|
|
||||||
|
const items = await Promise.all(
|
||||||
|
list.map(async (i, item) => {
|
||||||
|
item = $(item);
|
||||||
|
const link = baseURL + item.find('a').attr('href');
|
||||||
|
const description = await ctx.cache.tryGet(link, async () => {
|
||||||
|
const result = await got.get(link);
|
||||||
|
|
||||||
|
const $ = cheerio.load(result.data);
|
||||||
|
|
||||||
|
return $('#ivs_content').html();
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
title: item.find('a').text(),
|
||||||
|
pubDate: new Date(item.find('.listTime').text()),
|
||||||
|
link,
|
||||||
|
description,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: '上海市教育考试院',
|
||||||
|
description: '消息速递',
|
||||||
|
link: baseURL,
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
3
lib/v2/shmeea/maintainer.js
Normal file
3
lib/v2/shmeea/maintainer.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
'/': ['jialinghui'],
|
||||||
|
};
|
||||||
13
lib/v2/shmeea/radar.js
Normal file
13
lib/v2/shmeea/radar.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
'shmeea.edu.cn': {
|
||||||
|
_name: '上海市教育考试院',
|
||||||
|
www: [
|
||||||
|
{
|
||||||
|
title: '消息速递',
|
||||||
|
docs: 'https://docs.rsshub.app/other.html#shang-hai-shi-jiao-yu-kao-shi-yuan',
|
||||||
|
source: ['/'],
|
||||||
|
target: '/shmeea',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
3
lib/v2/shmeea/router.js
Normal file
3
lib/v2/shmeea/router.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = function (router) {
|
||||||
|
router.get('', require('./index'));
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user