mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 13:14:55 +08:00
feat: 为rss补充media:content信息
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
"cheerio": "^1.0.0",
|
"cheerio": "^1.0.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"feed": "^4.2.2",
|
"feed": "^5.0.0",
|
||||||
"flatted": "^3.3.3",
|
"flatted": "^3.3.3",
|
||||||
"hono": "^4.7.5",
|
"hono": "^4.7.5",
|
||||||
"iconv-lite": "^0.6.3",
|
"iconv-lite": "^0.6.3",
|
||||||
|
|||||||
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@@ -27,8 +27,8 @@ importers:
|
|||||||
specifier: ^16.4.7
|
specifier: ^16.4.7
|
||||||
version: 16.4.7
|
version: 16.4.7
|
||||||
feed:
|
feed:
|
||||||
specifier: ^4.2.2
|
specifier: ^5.0.0
|
||||||
version: 4.2.2
|
version: 5.0.0
|
||||||
flatted:
|
flatted:
|
||||||
specifier: ^3.3.3
|
specifier: ^3.3.3
|
||||||
version: 3.3.3
|
version: 3.3.3
|
||||||
@@ -693,9 +693,9 @@ packages:
|
|||||||
fecha@4.2.3:
|
fecha@4.2.3:
|
||||||
resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==}
|
resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==}
|
||||||
|
|
||||||
feed@4.2.2:
|
feed@5.0.0:
|
||||||
resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==}
|
resolution: {integrity: sha512-b+xl8kQ/bxInBKTe3GLCGDFU45kFiDSIEEdDUAUGGThN1Jqpx+7uFb95NEPjI1JAjXy2iEFPzxHsK2rIEyJibw==}
|
||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=20', pnpm: '>=10'}
|
||||||
|
|
||||||
fetch-blob@3.2.0:
|
fetch-blob@3.2.0:
|
||||||
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
|
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
|
||||||
@@ -1772,7 +1772,7 @@ snapshots:
|
|||||||
|
|
||||||
fecha@4.2.3: {}
|
fecha@4.2.3: {}
|
||||||
|
|
||||||
feed@4.2.2:
|
feed@5.0.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
xml-js: 1.6.11
|
xml-js: 1.6.11
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,25 @@ const getRSS = (data: RouterData) => {
|
|||||||
name: item.author,
|
name: item.author,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
extensions: [
|
||||||
|
{
|
||||||
|
name: "media:content",
|
||||||
|
objects: {
|
||||||
|
_attributes: {
|
||||||
|
"xmlns:media": "http://search.yahoo.com/mrss/",
|
||||||
|
url: item.cover,
|
||||||
|
},
|
||||||
|
"media:thumbnail": {
|
||||||
|
_attributes: {
|
||||||
|
url: item.cover,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"media:description": item.desc ? {
|
||||||
|
_cdata: item.desc
|
||||||
|
} : "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const rssData = feed.rss2();
|
const rssData = feed.rss2();
|
||||||
|
|||||||
Reference in New Issue
Block a user