mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
@@ -440,6 +440,12 @@ category 列表:
|
|||||||
|
|
||||||
<Route author="geekrainy" example="/kmust/job/jobfairs" path="/universities/kmust/job/jobfairs" />
|
<Route author="geekrainy" example="/kmust/job/jobfairs" path="/universities/kmust/job/jobfairs" />
|
||||||
|
|
||||||
|
## 洛阳理工学院
|
||||||
|
|
||||||
|
### 教务处
|
||||||
|
|
||||||
|
<Route author="AngUOI" example="/lit/jwc" path="/universities/lit/jwc" />
|
||||||
|
|
||||||
## 南昌航空大学
|
## 南昌航空大学
|
||||||
|
|
||||||
### 教务处公告与新闻
|
### 教务处公告与新闻
|
||||||
|
|||||||
@@ -529,6 +529,9 @@ router.get('/sjtu/jwc/:type?', require('./routes/universities/sjtu/jwc'));
|
|||||||
// 江南大学
|
// 江南大学
|
||||||
router.get('/ju/jwc/:type?', require('./routes/universities/ju/jwc'));
|
router.get('/ju/jwc/:type?', require('./routes/universities/ju/jwc'));
|
||||||
|
|
||||||
|
// 洛阳理工学院
|
||||||
|
router.get('/lit/jwc', require('./routes/universities/lit/jwc'));
|
||||||
|
|
||||||
// 北京大学
|
// 北京大学
|
||||||
router.get('/pku/eecs/:type?', require('./routes/universities/pku/eecs'));
|
router.get('/pku/eecs/:type?', require('./routes/universities/pku/eecs'));
|
||||||
|
|
||||||
|
|||||||
55
lib/routes/universities/lit/jwc.js
Normal file
55
lib/routes/universities/lit/jwc.js
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
const cheerio = require('cheerio');
|
||||||
|
|
||||||
|
const host = 'http://www.lit.edu.cn/jwc/';
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: host,
|
||||||
|
});
|
||||||
|
|
||||||
|
const $ = cheerio.load(response.data);
|
||||||
|
const items = [];
|
||||||
|
|
||||||
|
// 获取头条文章
|
||||||
|
$('article.ulist').each(function() {
|
||||||
|
const list = $(this);
|
||||||
|
items.push({
|
||||||
|
title: `【头条】 ` + list.find('a').text(),
|
||||||
|
description: list.find('a').text(),
|
||||||
|
pubDate: list
|
||||||
|
.find('span')
|
||||||
|
.eq(-1)
|
||||||
|
.text(),
|
||||||
|
link: host + list.find('a').attr('href'),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取其它文章
|
||||||
|
$('article.post_box').each(function() {
|
||||||
|
const list = $(this);
|
||||||
|
const ddate = list
|
||||||
|
.find('.c-top')
|
||||||
|
.children('div')
|
||||||
|
.text()
|
||||||
|
.trim();
|
||||||
|
items.push({
|
||||||
|
title: list.find('a').attr('title'),
|
||||||
|
description: list.children('.c-con').text(),
|
||||||
|
pubDate: ddate.substring(0, 4) + `-` + ddate.substring(4),
|
||||||
|
link: host + list.find('a').attr('href'),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `洛理教务在线`,
|
||||||
|
link: host,
|
||||||
|
description: `规范管理 用心服务 欢迎您访问!`,
|
||||||
|
item: items.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
description: item.description,
|
||||||
|
pubDate: item.pubDate,
|
||||||
|
link: item.link,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user