mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -2607,4 +2607,31 @@
|
||||
},
|
||||
],
|
||||
},
|
||||
'cqwu.net': {
|
||||
_name: '重庆文理学院',
|
||||
www: [
|
||||
{
|
||||
title: '通知',
|
||||
docs: 'https://docs.rsshub.app/university.html#chong-qing-wen-li-xue-yuan',
|
||||
source: '/:type',
|
||||
target: (params) => {
|
||||
if (params.type === 'channel_7721.html')
|
||||
{
|
||||
return '/cqwu/news/notify';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '学术活动',
|
||||
docs: 'https://docs.rsshub.app/university.html#chong-qing-wen-li-xue-yuan',
|
||||
source: '/:type',
|
||||
target: (params) => {
|
||||
if (params.type === 'channel_7722.html')
|
||||
{
|
||||
return '/cqwu/news/academiceve';
|
||||
}
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2172,6 +2172,18 @@ type 列表:
|
||||
|
||||
</Route>
|
||||
|
||||
## 重庆文理学院
|
||||
|
||||
### 通知公告
|
||||
|
||||
<Route author="Fatpandac" example="/cqwu/news/academiceve" path="/cqwu/news/:type?" :paramsDesc="['可选,默认为 academiceve ']" radar="1">
|
||||
|
||||
| 通知公告 | 学术活动公告 |
|
||||
| ------- | ----------- |
|
||||
| notify | academiceve |
|
||||
|
||||
</Route>
|
||||
|
||||
## 重庆科技学院
|
||||
|
||||
### 教务处公告
|
||||
|
||||
@@ -728,6 +728,9 @@ router.get('/cqu/youth/:category', require('./routes/universities/cqu/youth/info
|
||||
router.get('/cqu/sci/:category', require('./routes/universities/cqu/sci/info'));
|
||||
router.get('/cqu/net/:category', require('./routes/universities/cqu/net/info'));
|
||||
|
||||
// 重庆文理学院
|
||||
router.get('/cqwu/news/:type?', require('./routes/universities/cqwu/news'));
|
||||
|
||||
// 南京信息工程大学
|
||||
router.get('/nuist/bulletin/:category?', require('./routes/universities/nuist/bulletin'));
|
||||
router.get('/nuist/jwc/:category?', require('./routes/universities/nuist/jwc'));
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require('url').resolve;
|
||||
|
||||
const host = 'http://www.cqwu.edu.cn';
|
||||
const map = {
|
||||
notify:'/channel_7721.html',
|
||||
academiceve: '/channel_7722.html',
|
||||
};
|
||||
const titleMap = {
|
||||
notify:'通知',
|
||||
academiceve:'学术活动',
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || 'academiceve';
|
||||
const link = host + map[type];
|
||||
const title = '重文理' + titleMap[type] + '公告';
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('ul[class="list-unstyled news-uls"]').find('li');
|
||||
ctx.state.data = {
|
||||
title: title,
|
||||
link: link,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('h4').text(),
|
||||
description: item.find('p').text(),
|
||||
pubDate: new Date(item.find('span[class="pull-right nes-date"]').text()).toUTCString(),
|
||||
link: url(host, item.find('a').attr('href')),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user