fix(route): Outage Report (#10166)

This commit is contained in:
Ethan Shen
2022-07-07 18:18:35 +08:00
committed by GitHub
parent 17402bb250
commit f0a838eb2a
7 changed files with 24 additions and 5 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ pageClass: routes
### Report
<RouteEn author="cxumol" example="/outagereport/ubisoft/5" path="/outagereport/:name/:count?" :paramsDesc="['Service name, spelling format must be consistent with URL', 'Counting threshold, will only be written in RSS if the number of people who report to stop serving is not less than this number']">
<RouteEn author="cxumol nczitzk" example="/outagereport/ubisoft/5" path="/outagereport/:name/:count?" :paramsDesc="['Service name, spelling format must be consistent with URL', 'Counting threshold, will only be written in RSS if the number of people who report to stop serving is not less than this number']">
Please skip the local service area code for `name`, for example `https://outage.report/us/verizon-wireless` to `verizon-wireless`.
+1 -1
View File
@@ -8,7 +8,7 @@ pageClass: routes
### Report
<Route author="cxumol" example="/outagereport/ubisoft/5" path="/outagereport/:name/:count?" :paramsDesc="['服务名称。 拼写格式须与 URL 保持一致', '计数门槛。 仅当报告停服的人不低于此数量时, 才会写进 RSS']">
<Route author="cxumol nczitzk" example="/outagereport/ubisoft/5" path="/outagereport/:name/:count?" :paramsDesc="['服务名称。 拼写格式须与 URL 保持一致', '计数门槛。 仅当报告停服的人不低于此数量时, 才会写进 RSS']">
其中 name 参数,请略过本地服务的区域码,例如 `https://outage.report/us/verizon-wireless` 填入 `verizon-wireless` 即可。
+1 -1
View File
@@ -1726,7 +1726,7 @@ router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('.
router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));
// Outage.Report
router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
// router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
// sixthtone
router.get('/sixthtone/news', lazyloadRouteHandler('./routes/sixthtone/news'));
@@ -35,7 +35,7 @@ module.exports = async (ctx) => {
description: String(gaugeCount) + ' ' + gaugeText,
pubDate: new Date().toUTCString(),
guid: new Date().getTime(),
link: URL,
link: url,
};
outageHistory.push(outageReportItem);
}
@@ -43,7 +43,7 @@ module.exports = async (ctx) => {
// how this RSS feed looks like
ctx.state.data = {
title: `Is ${serviceName} Down Right Now?`,
link: URL,
link: url,
description: rssDescribe,
item: outageHistory,
allowEmpty: true,
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/:name/:count?': ['cxumol', 'nczitzk'],
};
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
'outage.report': {
_name: 'Outage.Report',
'.': [
{
title: 'Report',
docs: 'https://docs.rsshub.app/forecast.html#outage-report',
source: ['/'],
target: (params, url) => `/outagereport/${new URL(url).toString().split('/').pop()}`,
},
],
},
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = function (router) {
router.get('/:name/:count?', require('./index'));
};