feat: 增加辽宁工程技术大学教务公告

This commit is contained in:
ikvarxt
2020-04-19 15:21:44 +08:00
parent 300731a61d
commit 1feddfa37c
3 changed files with 39 additions and 0 deletions
+10
View File
@@ -664,6 +664,10 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
</Route>
## 教务公告
<Route author="ikvarxt" example="/lntu/jwnews" path="/lntu/jwnews" />
## 井冈山大学
### 教务处通知
@@ -696,6 +700,12 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS
<Route author="geekrainy" example="/kmust/job/jobfairs" path="/kmust/job/jobfairs" />
## 辽宁工程技术大学
### 教务公告
<Route author="ikvarxt" example="/lntu/jwnews" path="/lntu/jwnews" />
## 洛阳理工学院
### 教务处
+3
View File
@@ -2539,4 +2539,7 @@ router.get('/girlimg/album/:tag?/:mode?', require('./routes/girlimg/album'));
// etoland
router.get('/etoland/:bo_table', require('./routes/etoland/board'));
// 辽宁工程技术大学教务在线公告
router.get('/lntu/jwnews', require('./routes/universities/lntu/jwnews'));
module.exports = router;
+26
View File
@@ -0,0 +1,26 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const link = 'http://jwzx.lntu.edu.cn/index/jwgg.htm';
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('.tr-ri li').slice(0, 10);
ctx.state.data = {
title: '辽宁工程技术大学教务公告',
link: link,
description: '辽宁工程技术大学教务公告',
item:
list &&
list
.map((index, item) => {
item = $(item);
return {
title: item.find('li a').text(),
link: item.find('li a').attr('href'),
};
})
.get(),
};
};