diff --git a/docs/university.md b/docs/university.md index a247f9fdcf..cbb03e4aa4 100644 --- a/docs/university.md +++ b/docs/university.md @@ -182,6 +182,10 @@ pageClass: routes +### 人才招聘 + + + ## 北京林业大学 ### 绿色新闻网 diff --git a/lib/v2/bit/maintainer.js b/lib/v2/bit/maintainer.js new file mode 100644 index 0000000000..9dd417bee9 --- /dev/null +++ b/lib/v2/bit/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/rszhaopin': ['nczitzk'], +}; diff --git a/lib/v2/bit/radar.js b/lib/v2/bit/radar.js new file mode 100644 index 0000000000..0d73faa9af --- /dev/null +++ b/lib/v2/bit/radar.js @@ -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?', + }, + ], + }, +}; diff --git a/lib/v2/bit/router.js b/lib/v2/bit/router.js new file mode 100644 index 0000000000..8b006ea98e --- /dev/null +++ b/lib/v2/bit/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/rszhaopin', require('./rszhaopin')); +}; diff --git a/lib/v2/bit/rszhaopin.js b/lib/v2/bit/rszhaopin.js new file mode 100644 index 0000000000..e5e6a940f0 --- /dev/null +++ b/lib/v2/bit/rszhaopin.js @@ -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, + }; +};