diff --git a/docs/new-media.md b/docs/new-media.md index daed99a07..dfd359f19 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -4205,6 +4205,32 @@ wechat-feeds 来源[已停止更新](https://github.com/hellodword/wechat-feeds/ +## 香港 01 + +### 热门 + + + +### 栏目 + + + +### 子栏目 + + + +### 专题 + + + +### 标签 + + + +### 即時 + + + ## 香港高登 ### 頻道 diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 3eec061e9..cd48bf720 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -2217,28 +2217,6 @@ category 对应的关键词有 -## 香港 01 - -### 热门 - - - -### 栏目 - - - -### 子栏目 - - - -### 专题 - - - -### 标签 - - - ## 香港電台 ### 新聞 diff --git a/lib/v2/hk01/channel.js b/lib/v2/hk01/channel.js index 8d6f713d9..95cacf8ea 100644 --- a/lib/v2/hk01/channel.js +++ b/lib/v2/hk01/channel.js @@ -15,9 +15,9 @@ module.exports = async (ctx) => { const items = await ProcessItems(response.data.items, ctx.query.limit, ctx.cache.tryGet); ctx.state.data = { - title: `${response.data.category.publishName} | 香港01`, + title: response.data.category ? `${response.data.category.publishName} | 香港01` : `Channel: ${id} | 香港01`, link: currentUrl, item: items, - image: response.data.category.icon, + image: response.data.category ? response.data.category.icon : null, }; }; diff --git a/lib/v2/hk01/latest.js b/lib/v2/hk01/latest.js new file mode 100644 index 000000000..4018ca5e9 --- /dev/null +++ b/lib/v2/hk01/latest.js @@ -0,0 +1,20 @@ +const got = require('@/utils/got'); +const { rootUrl, apiRootUrl, ProcessItems } = require('./utils'); + +module.exports = async (ctx) => { + const currentUrl = `${rootUrl}/latest`; + const apiUrl = `${apiRootUrl}/v2/page/latest`; + + const response = await got({ + method: 'get', + url: apiUrl, + }); + + const items = await ProcessItems(response.data.items, ctx.query.limit, ctx.cache.tryGet); + + ctx.state.data = { + title: '即時 | 香港01', + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/hk01/maintainer.js b/lib/v2/hk01/maintainer.js index 8e3eec4d8..46d5a3055 100644 --- a/lib/v2/hk01/maintainer.js +++ b/lib/v2/hk01/maintainer.js @@ -1,6 +1,7 @@ module.exports = { '/channel/:id': ['hoilc', 'Fatpandac', 'nczitzk'], '/hot': ['hoilc', 'Fatpandac', 'nczitzk'], + '/latest': ['5upernova-heng'], '/issue/:id': ['hoilc', 'Fatpandac', 'nczitzk'], '/tag/:id': ['hoilc', 'Fatpandac', 'nczitzk'], '/zone/:id': ['hoilc', 'Fatpandac', 'nczitzk'], diff --git a/lib/v2/hk01/radar.js b/lib/v2/hk01/radar.js index ea7c30453..c749fdcea 100644 --- a/lib/v2/hk01/radar.js +++ b/lib/v2/hk01/radar.js @@ -4,34 +4,40 @@ module.exports = { '.': [ { title: '热门', - docs: 'https://docs.rsshub.app/traditional-media.html#xiang-gang-01-re-men', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-re-men', source: ['/hot', '/'], target: '/hk01/hot', }, { title: '栏目', - docs: 'https://docs.rsshub.app/traditional-media.html#xiang-gang-01-lan-mu', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-lan-mu', source: ['/zone/:id', '/'], target: '/hk01/zone/:id?', }, { title: '子栏目', - docs: 'https://docs.rsshub.app/traditional-media.html#xiang-gang-01-zi-lan-mu', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-zi-lan-mu', source: ['/channel/:id', '/'], target: '/hk01/channel/:id?', }, { title: '专题', - docs: 'https://docs.rsshub.app/traditional-media.html#xiang-gang-01-zhuan-ti', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-zhuan-ti', source: ['/issue/:id', '/'], target: '/hk01/issue/:id?', }, { title: '标签', - docs: 'https://docs.rsshub.app/traditional-media.html#xiang-gang-01-biao-qian', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-biao-qian', source: ['/tag/:id', '/'], target: '/hk01/tag/:id?', }, + { + title: '即時', + docs: 'https://docs.rsshub.app/new-media.html#xiang-gang-01-ji-shi', + source: ['/latest', '/'], + target: '/hk01/latest', + }, ], }, }; diff --git a/lib/v2/hk01/router.js b/lib/v2/hk01/router.js index 4c10ee89f..ef105c522 100644 --- a/lib/v2/hk01/router.js +++ b/lib/v2/hk01/router.js @@ -2,6 +2,7 @@ module.exports = function (router) { router.get('/channel/:id?', require('./channel')); router.get('/hot', require('./hot')); router.get('/issue/:id?', require('./issue')); + router.get('/latest', require('./latest')); router.get('/tag/:id?', require('./tag')); router.get('/zone/:id?', require('./zone')); };