${item.GJZ}
`, + pubDate: timezone(parseDate(item.JDRQ), +8), + link: `${rootUrl}/HKMAC/indexMac/getWzxx?id=${item.ID}`, + })); + + items = await Promise.all( + items.map((item) => + ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + + item.author = detailResponse.data.WZLY; + item.description = art(path.join(__dirname, 'templates/description.art'), { + rootUrl, + content: detailResponse.data.CONTENT, + image: detailResponse.data.URL, + files: detailResponse.data.fjlist, + video: detailResponse.data.VIDEO.indexOf('.mp4') > 0 ? detailResponse.data.VIDEO : null, + }); + item.link = `${rootUrl}/HKMAC/webView/mc/AboutUs_1.html?${category}&${titles[category]}`; + + return item; + }) + ) + ); + + ctx.state.data = { + title: `${titles[category]} - 全国港澳研究会`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/cahkms/maintainer.js b/lib/v2/cahkms/maintainer.js new file mode 100644 index 000000000..81eb78d73 --- /dev/null +++ b/lib/v2/cahkms/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:category?': ['nczitzk'], +}; diff --git a/lib/v2/cahkms/radar.js b/lib/v2/cahkms/radar.js new file mode 100644 index 000000000..8d0d3197a --- /dev/null +++ b/lib/v2/cahkms/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'cahkms.org': { + _name: '全国港澳研究会', + '.': [ + { + title: '分类', + docs: 'https://docs.rsshub.app/new-media.html#quan-guo-gang-ao-yan-jiu-hui-fen-lei', + source: '/', + target: '/cahkms/:category?', + }, + ], + }, +}; diff --git a/lib/v2/cahkms/router.js b/lib/v2/cahkms/router.js new file mode 100644 index 000000000..cf781366f --- /dev/null +++ b/lib/v2/cahkms/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/:category?', require('./index')); +}; diff --git a/lib/v2/cahkms/templates/description.art b/lib/v2/cahkms/templates/description.art new file mode 100644 index 000000000..6382ac79e --- /dev/null +++ b/lib/v2/cahkms/templates/description.art @@ -0,0 +1,15 @@ +{{ if image }} +