feat: 吉林大学 校内通知 (#5183)

This commit is contained in:
276562578 2020-07-28 13:09:15 +08:00 committed by GitHub
parent c457ec90af
commit b4bc6995a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 0 deletions

View File

@ -757,6 +757,12 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
<Route author="jackyu1996" example="/ccnu/career" path="/ccnu/career" />
## 吉林大学
### 校内通知
<Route author="276562578" example="/jlu/oa" path="/jlu" />
## 江南大学
### 教务处通知

View File

@ -2953,4 +2953,7 @@ router.get('/ngbj/cat/:cat', require('./routes/niaogebiji/cat'));
// 东方我乐多丛志
router.get('/touhougarakuta/:language/:type', require('./routes/touhougarakuta'));
// 吉林大学校内通知
router.get('/jlu/oa', require('./routes/universities/jlu/oa'));
module.exports = router;

View File

@ -0,0 +1,31 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://oa.jlu.edu.cn/defaultroot/PortalInformation!jldxList.action',
});
const data = response.data;
const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML
const list = $('div[class="li rel"]');
ctx.state.data = {
title: 'jlu oa',
link: 'https://oa.jlu.edu.cn/defaultroot/PortalInformation!jldxList.action',
item:
list &&
list
.map((index, item) => {
item = $(item);
return {
title: item.find('a.font14').text(),
description: item.find('a.column').text(),
link: item.find('a.font14').attr('href'),
};
})
.get(),
};
};