parent
ba25a745fb
commit
b8bdf9ca58
|
|
@ -2057,6 +2057,22 @@ category 列表:
|
|||
|
||||
工作通知:无
|
||||
|
||||
### 成都信息工程大学
|
||||
|
||||
#### 成信新闻网 <Author uid="kimika"/>
|
||||
|
||||
举例: <https://rsshub.app/cuit/cxxww/1>
|
||||
|
||||
路由: `/cuit/cxxww/:type?`
|
||||
|
||||
参数:
|
||||
|
||||
- type, 可选, 默认为 `1`
|
||||
|
||||
| 综合新闻 | 信息公告 | 焦点新闻 | 学术动态 | 工作交流 |
|
||||
| -------- | -------- | -------- | -------- | -------- |
|
||||
| 1 | 2 | 3 | 4 | 5 |
|
||||
|
||||
### 重庆科技学院
|
||||
|
||||
#### 教务处公告 <Author uid="binarization"/>
|
||||
|
|
|
|||
|
|
@ -506,6 +506,9 @@ router.get('/nchu/jwc/:type?', require('./routes/universities/nchu/jwc'));
|
|||
// 哈尔滨工程大学
|
||||
router.get('/heu/ugs/news/:author?/:category?', require('./routes/universities/heu/ugs/news'));
|
||||
|
||||
// 成都信息工程大学
|
||||
router.get('/cuit/cxxww/:type?', require('./routes/universities/cuit/cxxww'));
|
||||
|
||||
// 重庆科技学院
|
||||
router.get('/cqust/jw/:type?', require('./routes/universities/cqust/jw'));
|
||||
router.get('/cqust/lib/:type?', require('./routes/universities/cqust/lib'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
const axios = require('../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
const resolve_url = require('url').resolve;
|
||||
|
||||
const host = 'http://www.cuit.edu.cn/';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || '1';
|
||||
const link = host + 'NewsList?id=' + type;
|
||||
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: link,
|
||||
headers: {
|
||||
Referer: host,
|
||||
},
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
ctx.state.data = {
|
||||
link: link,
|
||||
title: $('#NewsTypeName').text(),
|
||||
item: $('.news1-links-ul>li')
|
||||
.map((_, elem) => ({
|
||||
link: resolve_url(link, $('a', elem).attr('href')),
|
||||
title: $('a', elem).text(),
|
||||
pubDate: new Date(
|
||||
$('.datetime', elem)
|
||||
.text()
|
||||
.replace('[', '')
|
||||
.replace(']', '')
|
||||
).toUTCString(),
|
||||
description: ' ',
|
||||
}))
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue