mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-15 10:15:23 +08:00
@@ -1095,6 +1095,20 @@ category 列表:
|
|||||||
|
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
### 四川旅游学院
|
||||||
|
|
||||||
|
<route name="信息与工程学院动态公告" author="talenHuang" example="/sctu/xgxy" path="/universities/sctu/xgxy">
|
||||||
|
|
||||||
|
</route>
|
||||||
|
|
||||||
|
<route name="教务处" author="talenHuang" example="/sctu/jwc/13" path="/universities/sctu/jwc:type?" :paramsDesc="['可选参数, 默认为 `13`']">
|
||||||
|
|
||||||
|
| 教务通知 | 信息公告 |
|
||||||
|
| -------- | -------- |
|
||||||
|
| 13 | 14 |
|
||||||
|
|
||||||
|
</route>
|
||||||
|
|
||||||
## 传统媒体
|
## 传统媒体
|
||||||
|
|
||||||
### 央视新闻
|
### 央视新闻
|
||||||
|
|||||||
@@ -527,6 +527,10 @@ router.get('/cqust/lib/:type?', require('./routes/universities/cqust/lib'));
|
|||||||
router.get('/cczu/jwc/:category?', require('./routes/universities/cczu/jwc'));
|
router.get('/cczu/jwc/:category?', require('./routes/universities/cczu/jwc'));
|
||||||
router.get('/cczu/news/:category?', require('./routes/universities/cczu/news'));
|
router.get('/cczu/news/:category?', require('./routes/universities/cczu/news'));
|
||||||
|
|
||||||
|
// 四川旅游学院
|
||||||
|
router.get('/sctu/xgxy', require('./routes/universities/sctu/xgxy'));
|
||||||
|
router.get('/sctu/jwc/:type?', require('./routes/universities/sctu/jwc'));
|
||||||
|
|
||||||
// ifanr
|
// ifanr
|
||||||
router.get('/ifanr/appso', require('./routes/ifanr/appso'));
|
router.get('/ifanr/appso', require('./routes/ifanr/appso'));
|
||||||
|
|
||||||
|
|||||||
42
routes/universities/sctu/jwc.js
Normal file
42
routes/universities/sctu/jwc.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
const axios = require('../../../utils/axios');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
const iconv = require('iconv-lite');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const dirname = 'http://www.sctu.edu.cn/jwc/';
|
||||||
|
const response = await axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `${dirname}list.asp?type=12&fl=${+ctx.params.type === 14 ? 14 : 13}`,
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
headers: {
|
||||||
|
Referer: 'http://www.sctu.edu.cn',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// HTML-buffer转为gb2312
|
||||||
|
const data = iconv.decode(response.data, 'gb2312');
|
||||||
|
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
const list = $('#list1 ul li');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: '四川旅游学院首页',
|
||||||
|
link: 'http://www.sctu.edu.cn',
|
||||||
|
description: $('meta[name="description"]').attr('content'),
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: $(item.find('a')).text(),
|
||||||
|
pubDate: $(item.find('dl')).text(),
|
||||||
|
description: `发布日期:${$(item.find('dl')).text()}`,
|
||||||
|
link: `${dirname + $(item.find('a')).attr('href')}`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
39
routes/universities/sctu/xgxy.js
Normal file
39
routes/universities/sctu/xgxy.js
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
const axios = require('../../../utils/axios');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
const iconv = require('iconv-lite');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await axios({
|
||||||
|
method: 'get',
|
||||||
|
url: 'http://it.sctu.edu.cn/list.asp?fa=2&fl=12&zi=0',
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
headers: {
|
||||||
|
Referer: 'http://it.sctu.edu.cn/',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// HTML-buffer转为gb2312
|
||||||
|
const data = iconv.decode(response.data, 'gb2312');
|
||||||
|
|
||||||
|
const $ = cheerio.load(data);
|
||||||
|
|
||||||
|
const list = $('.list_dt a');
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: '四川旅游学院首页',
|
||||||
|
link: 'http://www.sctu.edu.cn',
|
||||||
|
description: $('meta[name="description"]').attr('content'),
|
||||||
|
item:
|
||||||
|
list &&
|
||||||
|
list
|
||||||
|
.map((index, item) => {
|
||||||
|
item = $(item);
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: $(item.find('div')[0]).text(),
|
||||||
|
description: $(item.find('div')[1]).text(),
|
||||||
|
link: `http://it.sctu.edu.cn/${item.attr('href')}`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.get(),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user