mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 05:59:00 +08:00
feat: add macau government wuhan infection news (#3844)
This commit is contained in:
@@ -151,3 +151,13 @@ Type
|
||||
### South China Morning Post - China coronavirus outbreak
|
||||
|
||||
<RouteEn author="DIYgod" example="/coronavirus/scmp" path="/coronavirus/scmp"/>
|
||||
|
||||
### Macao Pagina Electrónica Especial Contra Epidemias: What’s New
|
||||
|
||||
Official Website: [https://www.ssm.gov.mo/apps1/PreventWuhanInfection/en.aspx](https://www.ssm.gov.mo/apps1/PreventWuhanInfection/en.aspx)
|
||||
|
||||
<Route author="KeiLongW" example="/coronavirus/mogov-2019ncov/ch" path="/coronavirus/mogov-2019ncov/:lang" :paramsDesc="['Language']" />
|
||||
|
||||
| Chinese | English | Portuguese |
|
||||
| ------- | ------- | ---------- |
|
||||
| ch | en | pt |
|
||||
|
||||
@@ -410,6 +410,16 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
<Route author="DIYgod" example="/coronavirus/scmp" path="/coronavirus/scmp"/>
|
||||
|
||||
### 澳門特別行政區政府 抗疫專頁:最新消息
|
||||
|
||||
官方網址:[https://www.ssm.gov.mo/apps1/PreventWuhanInfection/ch.aspx](https://www.ssm.gov.mo/apps1/PreventWuhanInfection/ch.aspx)
|
||||
|
||||
<Route author="KeiLongW" example="/coronavirus/mogov-2019ncov/ch" path="/coronavirus/mogov-2019ncov/:lang" :paramsDesc="['語言']"/>
|
||||
|
||||
| 中文 | 英文 | 葡文 |
|
||||
| ---- | ---- | ---- |
|
||||
| ch | en | pt |
|
||||
|
||||
## 新趣集
|
||||
|
||||
> 官方 Feed 地址为: [https://xinquji.com/rss](https://xinquji.com/rss)
|
||||
|
||||
@@ -2161,6 +2161,7 @@ router.get('/coronavirus/dxy/data/:province?/:city?', require('./routes/coronavi
|
||||
router.get('/coronavirus/dxy', require('./routes/coronavirus/dxy'));
|
||||
router.get('/coronavirus/scmp', require('./routes/coronavirus/scmp'));
|
||||
router.get('/coronavirus/nhc', require('./routes/coronavirus/nhc'));
|
||||
router.get('/coronavirus/mogov-2019ncov/:lang', require('./routes/coronavirus/mogov-2019ncov'));
|
||||
|
||||
// 南京林业大学教务处
|
||||
router.get('/njfu/jwc/:category?', require('./routes/universities/njfu/jwc'));
|
||||
|
||||
64
lib/routes/coronavirus/mogov-2019ncov.js
Normal file
64
lib/routes/coronavirus/mogov-2019ncov.js
Normal file
@@ -0,0 +1,64 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const FormData = require('form-data');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const language = ctx.params.lang.toLowerCase();
|
||||
|
||||
const dataUrl = `https://www.ssm.gov.mo/apps1/apps/webpage2020/wpg/gcsnewssc_body.aspx`;
|
||||
const form = new FormData();
|
||||
form.append('pg', '0');
|
||||
form.append('lang', language);
|
||||
|
||||
const dateTextMapping = {
|
||||
ch: '日期 : ',
|
||||
pt: 'Date : ',
|
||||
en: 'Date : ',
|
||||
};
|
||||
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
url: dataUrl,
|
||||
data: form,
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
const items = $('div.col-xs-12')
|
||||
.map((i, elem) => {
|
||||
const $item = cheerio.load(elem);
|
||||
const title = $item('div > span.padding-sm > b > a:first-child').text();
|
||||
const $descriptionWrapper = cheerio.load('<div></div>');
|
||||
$descriptionWrapper('div').append(
|
||||
$item('div.clearfix')
|
||||
.first()
|
||||
.nextAll()
|
||||
);
|
||||
const description = $descriptionWrapper.html();
|
||||
const pubDate = new Date(
|
||||
$descriptionWrapper('div.padding-sm.fontsize-sm')
|
||||
.text()
|
||||
.replace(dateTextMapping[language], '') + ' +8'
|
||||
).toUTCString();
|
||||
const link = $item('div > span.padding-sm > b > a:first-child').attr('href');
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
pubDate,
|
||||
link,
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
const titleMapping = {
|
||||
ch: '澳門特別行政區政府 抗疫專頁:最新消息',
|
||||
pt: 'Macau Pagina Electrónica Especial Contra Epidemias: Notícias',
|
||||
en: 'Macao Pagina Electrónica Especial Contra Epidemias: What’s New',
|
||||
};
|
||||
const sourceLink = `https://www.ssm.gov.mo/apps1/PreventWuhanInfection/${language}.aspx`;
|
||||
|
||||
ctx.state.data = {
|
||||
title: titleMapping[language],
|
||||
link: sourceLink,
|
||||
description: titleMapping[language],
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user