昆明理工大学教务处通知新闻及就业信息 (#782)
This commit is contained in:
parent
223d20a972
commit
65f83cec38
|
|
@ -1139,6 +1139,26 @@ category 列表:
|
|||
|
||||
</route>
|
||||
|
||||
### 昆明理工大学
|
||||
|
||||
<route name="教务处" author="geekrainy" example="/kmust/jwc/notify" path="/universities/kmust/jwc/:type?" :paramsDesc="['默认为 `notify`']">
|
||||
|
||||
| 教务通知 | 教务新闻 |
|
||||
| -------- | -------- |
|
||||
| notify | news |
|
||||
|
||||
</route>
|
||||
|
||||
<route name="宣讲会" author="geekrainy" example="/kmust/job/careers/inner" path="/universities/kmust/job/careers/:type?" :paramsDesc="['默认为 `inner`']">
|
||||
|
||||
| 校内宣讲会 | 校外宣讲会 |
|
||||
| ---------- | ---------- |
|
||||
| inner | outer |
|
||||
|
||||
</route>
|
||||
|
||||
<route name="双选会" author="geekrainy" example="/kmust/job/jobfairs" path="/universities/kmust/job/jobfairs" />
|
||||
|
||||
## 传统媒体
|
||||
|
||||
### 央视新闻
|
||||
|
|
|
|||
|
|
@ -539,6 +539,11 @@ router.get('/sctu/jwc/:type?', require('./routes/universities/sctu/jwc'));
|
|||
router.get('/uestc/jwc/:type?', require('./routes/universities/uestc/jwc'));
|
||||
router.get('/uestc/news/:type?', require('./routes/universities/uestc/news'));
|
||||
|
||||
// 昆明理工大学
|
||||
router.get('/kmust/jwc/:type?', require('./routes/universities/kmust/jwc'));
|
||||
router.get('/kmust/job/careers/:type?', require('./routes/universities/kmust/job/careers'));
|
||||
router.get('/kmust/job/jobfairs', require('./routes/universities/kmust/job/jobfairs'));
|
||||
|
||||
// ifanr
|
||||
router.get('/ifanr/appso', require('./routes/ifanr/appso'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
const axios = require('../../../../utils/axios');
|
||||
const url = require('url');
|
||||
|
||||
const baseUrl = 'http://job.kmust.edu.cn';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || 'inner';
|
||||
const title = `${type === 'inner' ? '校内宣讲会' : '校外宣讲会'}-昆明理工大学就业网`;
|
||||
const pageUrl = url.resolve(baseUrl, `/module/getcareers?start_page=1&keyword=&type=${type}&day=&count=20&start=1&_=${+new Date()}`);
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: pageUrl,
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
},
|
||||
});
|
||||
const data = response.data || {};
|
||||
|
||||
ctx.state.data = {
|
||||
title,
|
||||
link: url.resolve(baseUrl, `/module/careers${type === 'outer' && '?type=outer'}`),
|
||||
item:
|
||||
data.data &&
|
||||
data.data.map((item) => {
|
||||
const { meet_day = '', meet_time = '', company_name = '', school_name = '', address = '', company_property = '', industry_category = '', recommend_time = '', career_talk_id = '' } = item;
|
||||
return {
|
||||
title: `【${meet_day} ${meet_time}】${company_name}`,
|
||||
description: `时间:${meet_day} ${meet_time}<br>地点:${school_name ? `${school_name}-${address}` : address}<br>类别:${company_property}<br>行业类别:${industry_category}`,
|
||||
pubDate: new Date(recommend_time).toUTCString(),
|
||||
link: url.resolve(baseUrl, `/detail/career?id=${career_talk_id}`),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
const axios = require('../../../../utils/axios');
|
||||
const url = require('url');
|
||||
|
||||
const baseUrl = 'http://job.kmust.edu.cn';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const title = '双选会-昆明理工大学就业网';
|
||||
const pageUrl = url.resolve(baseUrl, `/module/getjobfairs?start_page=1&keyword=&count=20&start=1&_=${+new Date()}`);
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: pageUrl,
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
},
|
||||
});
|
||||
const data = response.data || {};
|
||||
|
||||
ctx.state.data = {
|
||||
title,
|
||||
link: url.resolve(baseUrl, '/module/jobfairs'),
|
||||
item:
|
||||
data.data &&
|
||||
data.data.map((item) => {
|
||||
const { meet_day = '', meet_time = '', title = '', school_name = '', address = '', recommend_time = '', fair_id = '' } = item;
|
||||
return {
|
||||
title: `【${meet_day} ${meet_time}】${title}`,
|
||||
description: `时间:${meet_day} ${meet_time}<br>地点:${school_name ? `${school_name}-${address}` : address}`,
|
||||
pubDate: new Date(recommend_time).toUTCString(),
|
||||
link: url.resolve(baseUrl, `/detail/jobfair?id=${fair_id}`),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
const axios = require('../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require('url');
|
||||
|
||||
const baseUrl = 'http://jwc.kmust.edu.cn';
|
||||
const dataRegex = /(?:20\d{2})\/(?:\d{2})\/(?:\d{2})/;
|
||||
const typeProps = {
|
||||
notify: {
|
||||
url: '/html/jwtz/1.html',
|
||||
title: '教务通知',
|
||||
},
|
||||
news: {
|
||||
url: '/html/jwxw/1.html',
|
||||
title: '教务新闻',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || 'notify';
|
||||
const pageUrl = url.resolve(baseUrl, typeProps[type].url);
|
||||
const title = `${typeProps[type].title}-昆明理工大学`;
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: pageUrl,
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
ctx.state.data = {
|
||||
link: pageUrl,
|
||||
title,
|
||||
item: $('table[width="92%"] a[target="_blank"]')
|
||||
.map((_, elem) => ({
|
||||
link: url.resolve(baseUrl, elem.attribs.href),
|
||||
title: elem.children[0].data,
|
||||
pubDate: new Date(
|
||||
elem.attribs.href
|
||||
.match(dataRegex)[0]
|
||||
.split('/')
|
||||
.join('-')
|
||||
),
|
||||
}))
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue