mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
feat(route): add 北京理工大学人才招聘 (#8437)
This commit is contained in:
@@ -182,6 +182,10 @@ pageClass: routes
|
||||
|
||||
<Route author="sinofp" example="/bit/cs" path="/bit/cs" />
|
||||
|
||||
### 人才招聘
|
||||
|
||||
<Route author="nczitzk" example="/bit/rszhaopin" path="/bit/rszhaopin" />
|
||||
|
||||
## 北京林业大学
|
||||
|
||||
### 绿色新闻网
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/rszhaopin': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'bit.edu.cn': {
|
||||
_name: '北京理工大学',
|
||||
rszhaopin: [
|
||||
{
|
||||
title: '人才招聘',
|
||||
docs: 'https://docs.rsshub.app/university.html#bei-jing-li-gong-da-xue-ren-cai-zhao-pin',
|
||||
source: ['/'],
|
||||
target: '/bit/:category?',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/rszhaopin', require('./rszhaopin'));
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const rootUrl = 'https://rszhaopin.bit.edu.cn';
|
||||
const apiUrl = `${rootUrl}/ajax/ajaxService`;
|
||||
const currentUrl = `${rootUrl}/zp.html#/notices/0`;
|
||||
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
url: apiUrl,
|
||||
form: {
|
||||
__xml: 'A2GgW6kPrLjaqavT0I8o9cOIXCYxazGialM66OpRk0MhwwOeUI1mF8yRBJHzicA9uL8Y9gYrXjdMocslRUopTMDJSRAykGXsjUoPibT4uK8Rz8Zj7U00coBCcJibpVwRZzFk',
|
||||
__type: 'extTrans',
|
||||
},
|
||||
});
|
||||
|
||||
const items = response.data.return_data.list.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.content,
|
||||
pubDate: parseDate(item.createtime),
|
||||
link: `${rootUrl}/zp.html#/notice/${item.id}`,
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: '人才招聘 - 北京理工大学',
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user