diff --git a/lib/v2/gov/chongqing/sydwgkzp.js b/lib/v2/gov/chongqing/sydwgkzp.js new file mode 100644 index 000000000..0ee3d97ec --- /dev/null +++ b/lib/v2/gov/chongqing/sydwgkzp.js @@ -0,0 +1,47 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +// 重庆市事业单位公开招聘 +const sydwgkzpUrl = 'https://rlsbj.cq.gov.cn/zwxx_182/sydw/'; + +module.exports = async (ctx) => { + const { data: response } = await got(sydwgkzpUrl); + + const $ = cheerio.load(response); + + // 获取所有的标题 + const list = $('div.page-list .tab-item > li') + .toArray() + .map((item) => { + item = $(item); + const title = item.find('a').first(); + return { + // 文章标题 + title: title.text(), + // 文章链接 + link: `${sydwgkzpUrl}${title.attr('href')}`, + // 文章发布日期 + pubDate: parseDate(item.find('span').text()), + }; + }); + + // 获取每个通知的具体信息 + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got(item.link); + const $ = cheerio.load(response); + // 主题正文 + item.description = $('div[class="view TRS_UEDITOR trs_paper_default trs_web"]').first().html(); + return item; + }) + ) + ); + + ctx.state.data = { + title: '重庆市事业单位公开招聘', + link: sydwgkzpUrl, + item: items, + }; +}; diff --git a/lib/v2/gov/maintainer.js b/lib/v2/gov/maintainer.js index 58a570431..c2b921dfe 100644 --- a/lib/v2/gov/maintainer.js +++ b/lib/v2/gov/maintainer.js @@ -54,6 +54,7 @@ module.exports = { '/beijing/jw/tzgg': ['nczitzk'], '/beijing/kw/:channel': ['Fatpandac'], '/chongqing/rsks': ['Mai19930513'], + '/chongqing/sydwgkzp': ['MajexH'], '/dianbai/:path+': ['ShuiHuo'], '/gaozhou/:path+': ['ShuiHuo'], '/guangdong/tqyb/sncsyjxh': ['Fatpandac'], diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js index fb357bdb4..e846eeff0 100644 --- a/lib/v2/gov/radar.js +++ b/lib/v2/gov/radar.js @@ -437,6 +437,12 @@ module.exports = { source: ['/'], target: '/gov/chongqing/rsks', }, + { + title: '重庆事业单位公开招聘', + docs: 'https://docs.rsshub.app/routes/government#chong-qing-shi-ren-min-zheng-fu', + source: ['/'], + target: '/gov/chongqing/sydwgkzp', + }, ], }, 'csrc.gov.cn': { diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js index 3205f67b3..3ab2f03d9 100644 --- a/lib/v2/gov/router.js +++ b/lib/v2/gov/router.js @@ -46,6 +46,7 @@ module.exports = function (router) { router.get('/beijing/jw/tzgg', require('./beijing/jw/tzgg')); router.get('/beijing/kw/:channel', require('./beijing/kw/index')); router.get('/chongqing/rsks', require('./chongqing/rsks')); + router.get('/chongqing/sydwgkzp', require('./chongqing/sydwgkzp')); router.get(/dianbai(\/[\w/-]+)?/, require('./dianbai/dianbai')); router.get(/gaozhou(\/[\w/-]+)?/, require('./gaozhou/gaozhou')); router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh')); diff --git a/website/docs/routes/government.md b/website/docs/routes/government.md index a14f443b9..e6348b47e 100644 --- a/website/docs/routes/government.md +++ b/website/docs/routes/government.md @@ -327,6 +327,10 @@ Language +#### 事业单位公开招聘 {#chong-qing-shi-ren-min-zheng-fu-ren-li-she-bao-ju-shi-ye-dan-wei-gong-kai-zhao-pin} + + + ## 德阳市人民政府 {#de-yang-shi-ren-min-zheng-fu} ### 政府公开信息 {#de-yang-shi-ren-min-zheng-fu-zheng-fu-gong-kai-xin-xi}