Files
RSSHub/lib/v2/cma/radar.js
T
Ethan Shen 05d53e0148 feat(route): add 中国气象局天气预报频道 (#13805)
* feat(route): add 中国气象局天气预报频道

* fix null check

* update lib/v2/cma/channel.js

* update lib/v2/cma/radar.js

---------
2023-11-17 00:10:31 +08:00

19 lines
585 B
JavaScript

module.exports = {
'cma.cn': {
_name: '中国气象局',
weather: [
{
title: '天气预报频道',
docs: 'https://docs.rsshub.app/routes/forecast#zhong-guo-qi-xiang-ju-tian-qi-yu-bao-pin-dao',
source: ['/web/*'],
target: (_, url) => {
url = new URL(url).href;
const idMatches = url.match(/channel-(\d+)\.html/);
return `/cma/channel${idMatches ? `/${idMatches[1]}` : ''}`;
},
},
],
},
};