diff --git a/docs/government.md b/docs/government.md index 25bbf97dac..65b5029677 100644 --- a/docs/government.md +++ b/docs/government.md @@ -274,12 +274,16 @@ pageClass: routes -## 上海市职业能力考试院 +## 上海市人民政府 -### 考试项目 +### 上海市职业能力考试院 考试项目 +### 上海卫健委 疫情通报 + + + ## 世界贸易组织 ### 争端解决新闻 diff --git a/lib/router.js b/lib/router.js index 94fa06247d..a5058aab87 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2485,7 +2485,7 @@ router.get('/weixin/miniprogram/framework', lazyloadRouteHandler('./routes/tence router.get('/weixin/miniprogram/devtools', lazyloadRouteHandler('./routes/tencent/wechat/miniprogram/devtools')); // 开发者工具更新日志 router.get('/weixin/miniprogram/wxcloud/:caty?', lazyloadRouteHandler('./routes/tencent/wechat/miniprogram/wxcloud')); // 云开发更新日志 -// 武汉肺炎疫情动态 +// 新冠肺炎疫情动态 router.get('/coronavirus/caixin', lazyloadRouteHandler('./routes/coronavirus/caixin')); router.get('/coronavirus/dxy/data/:province?/:city?', lazyloadRouteHandler('./routes/coronavirus/dxy-data')); router.get('/coronavirus/dxy', lazyloadRouteHandler('./routes/coronavirus/dxy')); diff --git a/lib/routes/coronavirus/dxy-data.js b/lib/routes/coronavirus/dxy-data.js index 36ee5d7803..062ba12849 100644 --- a/lib/routes/coronavirus/dxy-data.js +++ b/lib/routes/coronavirus/dxy-data.js @@ -5,7 +5,7 @@ module.exports = async (ctx) => { const PROVINCE = ctx.params.province || '国内'; let CITY = ctx.params.city || ''; - const link = 'https://3g.dxy.cn/newh5/view/pneumonia'; + const link = 'https://ncov.dxy.cn/ncovh5/view/pneumonia'; const response = await got({ method: 'get', diff --git a/lib/routes/coronavirus/dxy.js b/lib/routes/coronavirus/dxy.js index 13cf609537..c95f1688a7 100644 --- a/lib/routes/coronavirus/dxy.js +++ b/lib/routes/coronavirus/dxy.js @@ -4,7 +4,7 @@ const { JSDOM } = require('jsdom'); module.exports = async (ctx) => { const response = await got({ method: 'get', - url: 'https://3g.dxy.cn/newh5/view/pneumonia', + url: 'https://ncov.dxy.cn/ncovh5/view/pneumonia', }); const dom = new JSDOM(response.data, { @@ -15,7 +15,7 @@ module.exports = async (ctx) => { ctx.state.data = { title: '全球新型肺炎疫情实时播报-丁香园', - link: 'https://3g.dxy.cn/newh5/view/pneumonia', + link: 'https://ncov.dxy.cn/ncovh5/view/pneumonia', item: data.map((item) => ({ title: item.title, description: item.summary, diff --git a/lib/v2/gov/radar.js b/lib/v2/gov/radar.js index bb5a1ca2d3..25eda4bfe8 100644 --- a/lib/v2/gov/radar.js +++ b/lib/v2/gov/radar.js @@ -294,11 +294,19 @@ module.exports = { }, ], }, - 'rsj.sh.gov.cn': { - _name: '上海市职业能力考试院', - '.': [ + 'sh.gov.cn': { + _name: '上海市人民政府', + wsjkw: [ { - title: '考试项目', + title: '上海卫健委 疫情通报', + docs: 'https://docs.rsshub.app/other.html#xin-guan-fei-yan-yi-qing-xin-wen-dong-tai-yi-qing-tong-bao-shang-hai-wei-jian-wei', + source: ['/'], + target: '/gov/shanghai/wsjkw/yqtb', + }, + ], + rsj: [ + { + title: '上海市职业能力考试院 考试项目', docs: 'https://docs.rsshub.app/government.html#shang-hai-shi-zhi-ye-neng-li-kao-shi-yuan-kao-shi-xiang-mu', source: ['/'], target: '/gov/shanghai/rsj/ksxm', diff --git a/lib/v2/gov/router.js b/lib/v2/gov/router.js index 21a6541c5c..732d910858 100644 --- a/lib/v2/gov/router.js +++ b/lib/v2/gov/router.js @@ -3,6 +3,7 @@ module.exports = function (router) { router.get('/shenzhen/hrss/szksy/:caty/:page?', require('./shenzhen/hrss/szksy/index')); router.get('/shenzhen/zzb/:caty/:page?', require('./shenzhen/zzb/index')); router.get('/shanghai/rsj/ksxm', require('./shanghai/rsj/ksxm')); + router.get('/shanghai/wsjkw/yqtb', require('./shanghai/wsjkw/yqtb')); router.get('/guangdong/tqyb/tfxtq', require('./guangdong/tqyb/tfxtq')); router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh')); }; diff --git a/lib/v2/gov/shanghai/wsjkw/yqtb/index.js b/lib/v2/gov/shanghai/wsjkw/yqtb/index.js new file mode 100644 index 0000000000..82f84404e4 --- /dev/null +++ b/lib/v2/gov/shanghai/wsjkw/yqtb/index.js @@ -0,0 +1,33 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const url = `https://wsjkw.sh.gov.cn/yqtb/index.html`; + + const res = await got.get(url); + const $ = cheerio.load(res.data); + const list = $('.uli16.nowrapli.list-date li'); + ctx.state.data = { + title: '疫情通报-上海卫健委', + link: url, + item: + list && + list + .map((index, item) => { + item = $(item); + const title = item.find('a').text(); + const address = item.find('a').attr('href'); + const host = `https://wsjkw.sh.gov.cn`; + const pubDate = parseDate(item.find('span').text(), 'YYYY-MM-DD'); + return { + title, + description: title, + pubDate, + link: host + address, + guid: host + address, + }; + }) + .get(), + }; +};