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

This commit is contained in:
ikvarxt
2020-04-19 19:14:07 +08:00
committed by GitHub
parent 9ef3943d04
commit 40dd6b84d5
3 changed files with 35 additions and 0 deletions

View File

@@ -702,6 +702,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" />
## 洛阳理工学院
### 教务处

View File

@@ -2543,6 +2543,9 @@ 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'));
// 51voa
router.get('/51voa/:channel', require('./routes/51voa/channel'));

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(),
};
};