diff --git a/lib/router.js b/lib/router.js index 87bf2f261..a772bca2d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2576,7 +2576,7 @@ router.get('/macau-bolsas/:lang?', lazyloadRouteHandler('./routes/macau-bolsas/i router.get('/potplayer/update/:language?', lazyloadRouteHandler('./routes/potplayer/update')); // 加美财经 -router.get('/caus/:category?', lazyloadRouteHandler('./routes/caus')); +// router.get('/caus/:category?', lazyloadRouteHandler('./routes/caus')); // 摩点 router.get('/modian/zhongchou/:category?/:sort?/:status?', lazyloadRouteHandler('./routes/modian/zhongchou')); diff --git a/lib/routes/caus/index.js b/lib/v2/caus/index.js similarity index 87% rename from lib/routes/caus/index.js rename to lib/v2/caus/index.js index 4c6d6d9a3..b3997570f 100644 --- a/lib/routes/caus/index.js +++ b/lib/v2/caus/index.js @@ -17,9 +17,9 @@ const categories = { title: '快讯', link: 'hours?id=3', }, - 4: { - title: '投资理财', - link: 'CFT?id=4', + 8: { + title: '财富', + link: 'fortune?id=8', }, 6: { title: '生活', @@ -59,8 +59,10 @@ module.exports = async (ctx) => { const list = (isHome ? response.data.data : response.data.data.articleList).map((item) => ({ title: item.title, - link: item.contentId, + link: `${rootUrl}/detail/${item.contentId}`, + contentId: item.contentId, pubDate: new Date(item.createTime), + category: [...new Set([...item.lanmus.map((lanmu) => lanmu.name), ...item.tags.map((tag) => tag.name)])], })); const items = await Promise.all( @@ -68,10 +70,9 @@ module.exports = async (ctx) => { ctx.cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', - url: `${apiRootUrl}/toronto/display/contentWithRelate?contentId=${item.link}`, + url: `${apiRootUrl}/toronto/display/contentWithRelate?contentId=${item.contentId}`, }); - item.link = `${rootUrl}/detail/${item.link}`; item.description = detailResponse.data.data.content.content; return item; diff --git a/lib/v2/caus/maintainer.js b/lib/v2/caus/maintainer.js new file mode 100644 index 000000000..81eb78d73 --- /dev/null +++ b/lib/v2/caus/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:category?': ['nczitzk'], +}; diff --git a/lib/v2/caus/radar.js b/lib/v2/caus/radar.js new file mode 100644 index 000000000..fb2fe3a89 --- /dev/null +++ b/lib/v2/caus/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'caus.com': { + _name: '加美财经', + '.': [ + { + title: '分类', + docs: 'https://docs.rsshub.app/routes/new-media#jia-mei-cai-jing', + source: ['/home', '/focus_news', '/hours', '/fortune', '/life'], + target: (_, url) => `/caus/${new URL(url).searchParams.get('id')}`, + }, + ], + }, +}; diff --git a/lib/v2/caus/router.js b/lib/v2/caus/router.js new file mode 100644 index 000000000..9885c36f1 --- /dev/null +++ b/lib/v2/caus/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:category?', require('./index')); +}; diff --git a/website/docs/routes/new-media.md b/website/docs/routes/new-media.md index 6f7f021e8..e7dd89c33 100644 --- a/website/docs/routes/new-media.md +++ b/website/docs/routes/new-media.md @@ -3011,11 +3011,13 @@ others = 热点新闻 + 滚动新闻 ## 加美财经 {#jia-mei-cai-jing} - +### 分类 {#jia-mei-cai-jing-fen-lei} -| 全部 | 要闻 | 商业 | 快讯 | 投资理财 | 生活 | + + +| 全部 | 要闻 | 商业 | 快讯 | 财富 | 生活 | | ---- | ---- | ---- | ---- | -------- | ---- | -| 0 | 1 | 2 | 3 | 4 | 6 | +| 0 | 1 | 2 | 3 | 8 | 6 |