fix(route): fix dxy; feat(route): add sh-wsjkw (#8922)

* fix(route)(dxy)

* add(route):上海卫健委疫情通报

* U 使用https获取上海疫情通报数据
U 移动上海疫情通报至gov

* U 删除多余router.js文件
U 移动上海疫情通报radar信息到上级radar中
U 修复doc中疫情通报地址错误的问题

* U 调整备注

* A 新增 pubDate

* U 和并radar中的上海市人民政府项目,合并doc中上海市人民政府项目

* U 时间标准化

* U 调整发布时间格式化

Co-authored-by: Zhou Caifa <caifa.zhou@naiveblue.com>

fix #9010
This commit is contained in:
周财发 2022-02-07 07:12:45 +08:00 committed by GitHub
parent ae152bdde4
commit 13883cafa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 10 deletions

View File

@ -274,12 +274,16 @@ pageClass: routes
<Route author="sgqy" example="/go.jp/mofa" path="/go.jp/mofa"/>
## 上海市职业能力考试院
## 上海市人民政府
### 考试项目
### 上海市职业能力考试院 考试项目
<Route author="Fatpandac" example="/gov/shanghai/rsj/ksxm" path="/gov/shanghai/rsj/ksxm"/>
### 上海卫健委 疫情通报
<Route author="zcf0508" example="/gov/shanghai/wsjkw/yqtb" path="/gov/shanghai/wsjkw/yqtb"/>
## 世界贸易组织
### 争端解决新闻

View File

@ -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'));

View File

@ -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',

View File

@ -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,

View File

@ -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',

View File

@ -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'));
};

View File

@ -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(),
};
};