feat: /sqmc/www 新乡医学院三全学院官网信息 (#13322)
* add /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg/:category? 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * Revert "feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告" This reverts commit 34c9411ef6ef3a5b92eb3f8995db5692fd12e3ec. * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /sqmc/www 新乡医学院三全学院官网信息 * feat: /sqmc/www 新乡医学院三全学院官网信息 * feat: /sqmc/www 新乡医学院三全学院官网信息 ---------
This commit is contained in:
parent
5d5f63dcec
commit
aba9c21290
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/www/:category?': ['nyaShine'],
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = {
|
||||
'sqmc.edu.cn': {
|
||||
_name: '新乡医学院三全学院',
|
||||
'.': [
|
||||
{
|
||||
title: '官网信息',
|
||||
docs: 'https://docs.rsshub.app/university.html#xin-xiang-yi-xue-yuan-san-quan-xue-yuan',
|
||||
source: ['/:category/list.htm'],
|
||||
target: '/sqmc/www/:category?',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/www/:category?', require('./www'));
|
||||
};
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const timezone = require('@/utils/timezone');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const category = ctx.params.category || '3157';
|
||||
|
||||
const rootUrl = 'https://www.sqmc.edu.cn';
|
||||
const currentUrl = `${rootUrl}/${category}/list.htm`;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('div#wp_news_w9 ul li').get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `新乡医学院三全学院官网信息${$('title').text()}`,
|
||||
link: currentUrl,
|
||||
item: await Promise.all(
|
||||
list.map(async (item) => {
|
||||
item = $(item);
|
||||
|
||||
const link = new URL(item.find('dt a').attr('href'), rootUrl).href;
|
||||
const pubDate = parseDate(item.find('dd').eq(0).text(), 'YYYY-MM-DD');
|
||||
|
||||
const cache = await ctx.cache.tryGet(link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: link,
|
||||
});
|
||||
const content = cheerio.load(detailResponse.data);
|
||||
|
||||
return {
|
||||
title: item.find('dt a').text(),
|
||||
description: content('div.Tr_Detail').html(),
|
||||
link,
|
||||
pubDate: timezone(pubDate, +8),
|
||||
};
|
||||
});
|
||||
|
||||
return cache;
|
||||
})
|
||||
),
|
||||
};
|
||||
};
|
||||
|
|
@ -3434,6 +3434,18 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
|
|||
|
||||
</Route>
|
||||
|
||||
## 新乡医学院三全学院 {#xin-xiang-yi-xue-yuan-san-quan-xue-yuan}
|
||||
|
||||
### 官网信息 {#xin-xiang-yi-xue-yuan-san-quan-xue-yuan-guan-wang-xin-xi}
|
||||
|
||||
<Route author="nyaShine" example="/sqmc/www/3157" path="/sqmc/www/:category?" paramsDesc={['分类ID,默认为`3157`']} radar="1">
|
||||
|
||||
| 学校要闻 | 通知 | 学术讲座 | 基层风采书院 | 基层风采院系 | 外媒报道 | 三全学院报 |
|
||||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| 3157 | 3187 | 3188 | 3185 | 3186 | 3199 | 3200 |
|
||||
|
||||
</Route>
|
||||
|
||||
## 信阳师范学院 {#xin-yang-shi-fan-xue-yuan}
|
||||
|
||||
### 高等教育自学考试办公室 {#xin-yang-shi-fan-xue-yuan-gao-deng-jiao-yu-zi-xue-kao-shi-ban-gong-shi}
|
||||
|
|
|
|||
Loading…
Reference in New Issue