Skip to content

Commit

Permalink
添加济南市卫建委获取国家医师资格考试通知的路由 (DIYgod#12222)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzjyxb authored Apr 3, 2023
1 parent 6509f4c commit 55a1d44
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/government.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ pageClass: routes

<Route author="Jeason0228" example="/gov/hunan/notice/all" path="/gov/hunan/notice/:type" :paramsDesc="['all=全部,cg=采购公告,zb=中标公告,fb=废标公告,ht=合同公告,gz=更正公告,zz=终止公告,qt=其他公告']" />

## 济南市卫生健康委员会

### 获取国家医师资格考试通知

<Route author="tzjyxb" example="/gov/jinan/healthcommission/medical_exam_notice" path="/gov/jinan/healthcommission/medical_exam_notice" radar="1"/>

## 江苏省人民政府

### 动态
Expand Down
48 changes: 48 additions & 0 deletions lib/v2/gov/jinan/healthcommission/medical_exam_notice.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');

module.exports = async (ctx) => {
const baseUrl = 'https://jnmhc.jinan.gov.cn';

const res = await got('https://jnmhc.jinan.gov.cn/module/web/jpage/dataproxy.jsp', {
searchParams: {
page: 1,
webid: 28,
path: '/',
columnid: 14418,
unitid: 18878,
webname: '济南市卫生健康委员会',
permissiontype: 0,
},
});

const $ = cheerio.load(res.data, {xmlMode: true});

const list = $('record');

ctx.state.data = {
title: '济南卫建委-执业考试通知',
link: `${baseUrl}/col/col14418/index.html`,
item: list.map((_, item) => {
// 获取每个item对应的html字符串
item = $(item).text();

// 解析上一步中的html
const html = cheerio.load(item);

const title = html('td[width="620"] a').attr('title');
const link = html('td[width="620"] a').attr('href');
const date = timezone(parseDate(html('td[width="100"]').text()), +8);
return {
title,
description: title,
pubDate: date,
link,
author: '济南市卫生健康委员会',
};
})
.get(),
};
};
1 change: 1 addition & 0 deletions lib/v2/gov/maintainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'/customs/list/:gchannel?': ['Jeason0228', 'TonyRL', 'he1q'],
'/fmprc/:category?': ['nicolaszf', 'nczitzk'],
'/immiau/news': ['liu233w'],
'/jinan/healthcommission/medical_exam_notice': ['tzjyxb'],
'/mee/ywdt?': ['liuxsdev'],
'/mfa/wjdt/:category?': ['nczitzk'],
'/miit/wjfb/:ministry': ['Fatpandac'],
Expand Down
11 changes: 11 additions & 0 deletions lib/v2/gov/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,17 @@ module.exports = {
},
],
},
'jinan.gov.cn': {
_name: '济南市卫生健康委员会',
jnmhc: [
{
title: '获取国家医师资格考试通知',
docs: 'https://docs.rsshub.app/government.html#ji-nan-shi-wei-sheng-jian-kang-wei-yuan-hui',
source: ['', '/*'],
target: '/gov/jinan/healthcommission/medical_exam_notice',
},
],
},
'maoming.gov.cn': {
_name: '茂名市人民政府门户网站',
'.': [
Expand Down
1 change: 1 addition & 0 deletions lib/v2/gov/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = function (router) {
router.get('/customs/list/:gchannel?', require('./customs/list'));
router.get('/fmprc/:category?', require('./mfa/wjdt'));
router.get('/immiau/news', require('./immiau/news'));
router.get('/jinan/healthcommission/medical_exam_notice', require('./jinan/healthcommission/medical_exam_notice'));
router.get('/mee/ywdt/:category?', require('./mee/ywdt'));
router.get('/mfa/wjdt/:category?', require('./mfa/wjdt'));
router.get('/miit/wjfb/:ministry', require('./miit/wjfb'));
Expand Down

0 comments on commit 55a1d44

Please sign in to comment.