feat: 华北水利水电大学学校通知 (#3653)
This commit is contained in:
parent
401bd2ffa0
commit
80797c1183
|
|
@ -388,6 +388,12 @@ category 列表:
|
|||
|
||||
</Route>
|
||||
|
||||
## 华北水利水电大学
|
||||
|
||||
### 学校通知
|
||||
|
||||
<Route author="vuhe" example="/ncwu/notice" path="/universities/ncwu/notice" />
|
||||
|
||||
## 华南理工大学
|
||||
|
||||
### 教务处通知公告
|
||||
|
|
|
|||
|
|
@ -723,6 +723,9 @@ router.get('/szu/yz/:type?', require('./routes/universities/szu/yz'));
|
|||
router.get('/upc/main/:type?', require('./routes/universities/upc/main'));
|
||||
router.get('/upc/jsj/:type?', require('./routes/universities/upc/jsj'));
|
||||
|
||||
// 华北水利水电大学
|
||||
router.get('/ncwu/notice', require('./routes/universities/ncwu/notice'));
|
||||
|
||||
// ifanr
|
||||
router.get('/ifanr/:channel?', require('./routes/ifanr/index'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
const got = require('@/utils/got');
|
||||
const date = require('@/utils/date');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const baseUrl = 'https://www5.ncwu.edu.cn/channels/5.html';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got.get(baseUrl);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('div.tongzhi>div.tzlist>ul>li');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '华水-学校通知',
|
||||
link: baseUrl,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => ({
|
||||
title: $(item)
|
||||
.find('span')
|
||||
.text(),
|
||||
description:
|
||||
`发自「` +
|
||||
$(item)
|
||||
.find('a.dw')
|
||||
.text() +
|
||||
`」`,
|
||||
pubDate: date(
|
||||
$(item)
|
||||
.find('i')
|
||||
.text()
|
||||
),
|
||||
link:
|
||||
baseUrl +
|
||||
$(item)
|
||||
.find('a[target=_blank]')
|
||||
.attr('href'),
|
||||
}))
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue