diff --git a/docs/government.md b/docs/government.md
index f3ba85f68..aa948e548 100644
--- a/docs/government.md
+++ b/docs/government.md
@@ -400,7 +400,7 @@ pageClass: routes
### CDRHNew
-
+
## 美国中央情报局
diff --git a/lib/v2/fda/cdrh.js b/lib/v2/fda/cdrh.js
index c236d0613..8a197c9f6 100644
--- a/lib/v2/fda/cdrh.js
+++ b/lib/v2/fda/cdrh.js
@@ -3,6 +3,7 @@ const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
+ const titleOnly = !!(ctx.params.titleOnly ?? '');
const rootUrl = 'https://www.fda.gov';
const currentUrl = `${rootUrl}/medical-devices/news-events-medical-devices/cdrhnew-news-and-updates`;
@@ -29,7 +30,7 @@ module.exports = async (ctx) => {
items = await Promise.all(
items.map((item) =>
- ctx.cache.tryGet(item.link, async () => {
+ ctx.cache.tryGet((titleOnly ? null : item.link), async () => {
const detailResponse = await got({
method: 'get',
url: item.link,
@@ -45,7 +46,8 @@ module.exports = async (ctx) => {
item.pubDate = parseDate(content('meta[property="article:published_time"]').attr('content'));
}
- item.description = content('div[role="main"], .doc-content-area').html();
+ item.description = titleOnly ? null : content('div[role="main"], .doc-content-area').html();
+ item.guid = titleOnly ? `${item.link}#titleOnly` : item.link;
return item;
})
diff --git a/lib/v2/fda/radar.js b/lib/v2/fda/radar.js
index a84167db3..18494334b 100644
--- a/lib/v2/fda/radar.js
+++ b/lib/v2/fda/radar.js
@@ -6,7 +6,7 @@ module.exports = {
title: 'CDRHNew',
docs: 'https://docs.rsshub.app/government.html#mei-guo-shi-pin-yao-pin-jian-du-guan-li-ju-cdrhnew',
source: ['/medical-devices/news-events-medical-devices/cdrhnew-news-and-updates', '/'],
- target: '/fda/cdrh',
+ target: '/fda/cdrh/:titleOnly',
},
],
},
diff --git a/lib/v2/fda/router.js b/lib/v2/fda/router.js
index b0f07a5ff..71a6566e0 100644
--- a/lib/v2/fda/router.js
+++ b/lib/v2/fda/router.js
@@ -1,3 +1,3 @@
module.exports = function (router) {
- router.get('/cdrh', require('./cdrh'));
+ router.get('/cdrh/:titleOnly?', require('./cdrh'));
};