mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -2590,4 +2590,21 @@
|
||||
},
|
||||
],
|
||||
},
|
||||
'cqut.edu.cn': {
|
||||
_name: '重庆理工大学',
|
||||
tz: [
|
||||
{
|
||||
title: '通知',
|
||||
docs: 'https://docs.rsshub.app/university.html#chong-qing-li-gong-da-xue',
|
||||
source: '/*',
|
||||
},
|
||||
],
|
||||
lib: [
|
||||
{
|
||||
title: '图书馆通知',
|
||||
docs: 'https://docs.rsshub.app/university.html#chong-qing-li-gong-da-xue',
|
||||
source: '/*',
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2194,6 +2194,16 @@ type 列表:
|
||||
|
||||
</Route>
|
||||
|
||||
## 重庆理工大学
|
||||
|
||||
### 学校通知
|
||||
|
||||
<Route author="Colin-XKL" example="/cqut/news" path="/cqut/news" radar="1"/>
|
||||
|
||||
### 图书馆通知
|
||||
|
||||
<Route author="Colin-XKL" example="/cqut/libnews" path="/cqut/libnews" radar="1"/>
|
||||
|
||||
## 中山大学
|
||||
|
||||
### 数据科学与计算机学院动态
|
||||
|
||||
@@ -3878,4 +3878,8 @@ router.get('/newzmz/:category?', require('./routes/newzmz/index'));
|
||||
// Phrack Magazine
|
||||
router.get('/phrack', require('./routes/phrack/index'));
|
||||
|
||||
// CQUT News
|
||||
router.get('/cqut/news', require('./routes/universities/cqut/cqut-news'));
|
||||
router.get('/cqut/libnews', require('./routes/universities/cqut/cqut-libnews'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://libnews.cqut.edu.cn/',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
|
||||
const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML
|
||||
const list = $('#infoList').find('div');
|
||||
|
||||
ctx.state.data = {
|
||||
title: '重庆理工大学中山图书馆资讯',
|
||||
link: 'https://libnews.cqut.edu.cn',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a').text().trim(),
|
||||
description: item.find('a').text().trim(),
|
||||
link: item.find('a').attr('href'),
|
||||
pubDate: new Date(item.find('span').text().trim().slice(1, -1)).toUTCString(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
const cheerio = require('cheerio');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://tz.cqut.edu.cn/',
|
||||
});
|
||||
|
||||
const data = response.data;
|
||||
const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML
|
||||
const list = $('#container').find('.record');
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'CQUT',
|
||||
link: 'https://tz.cqut.edu.cn/',
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a').attr('title'),
|
||||
description: item.find('a').attr('title'),
|
||||
link: item.find('a').attr('href'),
|
||||
pubDate: new Date(item.find('.date').text().trim()).toUTCString(),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user