mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
feat: 添加华中师范大学就业信息 (#3257)
This commit is contained in:
@@ -410,6 +410,18 @@ category 列表:
|
||||
|
||||
<Route author="RayHY" example="/hust/aia/news" path="/universities/hust/aia/news" />
|
||||
|
||||
## 华中师范大学
|
||||
|
||||
### 就业信息
|
||||
|
||||
<Route author="jackyu1996" example="/ccnu/career/0" path="/universities/ccnu/career/:type" :paramsDesc="['对应以下不同类别']">
|
||||
|
||||
| 校内专场 | 校外专场 | 大型招聘会 | 综合信息 | 周五双选会 |
|
||||
| -------- | -------- | ---------- | -------- | ---------- |
|
||||
| 0 | 1 | 2 | 3 | 4 |
|
||||
|
||||
</Route>
|
||||
|
||||
## 江南大学
|
||||
|
||||
### 教务处通知
|
||||
|
||||
@@ -1267,6 +1267,9 @@ router.get('/zju/grs/:type', require('./routes/universities/zju/grs'));
|
||||
router.get('/zju/career/:type', require('./routes/universities/zju/career'));
|
||||
router.get('/zju/cst/:type', require('./routes/universities/zju/cst'));
|
||||
|
||||
// 华中师范大学
|
||||
router.get('/ccnu/career/:type', require('./routes/universities/ccnu/career'));
|
||||
|
||||
// Infoq
|
||||
router.get('/infoq/recommend', require('./routes/infoq/recommend'));
|
||||
router.get('/infoq/topic/:id', require('./routes/infoq/topic'));
|
||||
|
||||
43
lib/routes/universities/ccnu/career.js
Normal file
43
lib/routes/universities/ccnu/career.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const host = 'http://career.ccnu.edu.cn';
|
||||
|
||||
const scheduleCatPrefix = 'ScheduleCategory?type=';
|
||||
|
||||
const schedules = ['校内专场', '校外专场', '大型招聘会', '综合信息'].map((x) => new Map([['type', x], ['suffix', `${scheduleCatPrefix}${encodeURIComponent(x)}`]]));
|
||||
const zwssh = new Map([['type', '周五双选会'], ['suffix', 'ZWSSHList']]);
|
||||
schedules.push(zwssh);
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = Number.parseInt(ctx.params.type);
|
||||
const urlSuffix = schedules[id].get('suffix');
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: `${host}/Schedule/${urlSuffix}`,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('ul.nlist li');
|
||||
|
||||
const items =
|
||||
list &&
|
||||
list
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a').text(),
|
||||
pubDate: new Date(item.find('span').text()).toUTCString(),
|
||||
link: `${host}${item
|
||||
.find('a')
|
||||
.eq(0)
|
||||
.attr('href')}`,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: '华中师范大学就业信息',
|
||||
link: host,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user