style: auto format

This commit is contained in:
github-actions[bot] 2024-05-10 14:57:38 +00:00
parent 9268d27e00
commit 9c9e3d4d6d
5 changed files with 29 additions and 6 deletions

View File

@ -49,7 +49,12 @@ export const handler = async (ctx) => {
.match(/{"title":".*?"string":".*?"}}/g)
.slice(0, limit)
.map((item) => {
item = JSON.parse(item.replaceAll(String.raw`\\"`, String.raw`\"`).replaceAll(String.raw`\\n`, '').replaceAll('\\`', '`'));
item = JSON.parse(
item
.replaceAll(String.raw`\\"`, String.raw`\"`)
.replaceAll(String.raw`\\n`, '')
.replaceAll('\\`', '`')
);
const $$ = unblurImages(load(item.excerpt));

View File

@ -55,7 +55,12 @@ async function handler(ctx) {
const content = load(detailResponse.data.match(/"content":"(.*)"}},"secondaryList":/)[1]);
content('img').each(function () {
content(this).attr('src', content(this).attr('src').replaceAll(String.raw`\"`, ''));
content(this).attr(
'src',
content(this)
.attr('src')
.replaceAll(String.raw`\"`, '')
);
});
item.description = content.html();

View File

@ -59,7 +59,12 @@ async function handler(ctx) {
const content = load(detailResponse.data.match(/"content":"(.*)","extraction_tags":/)[1]);
content('img').each(function () {
content(this).attr('src', content(this).attr('src').replaceAll(String.raw`\"`, ''));
content(this).attr(
'src',
content(this)
.attr('src')
.replaceAll(String.raw`\"`, '')
);
});
item.description = content.html();

View File

@ -68,9 +68,15 @@ async function handler(ctx) {
return {
title: item.find('title').text().trim(),
link: item.find('link').text().trim(),
author: item.find(String.raw`dc\:creator`).text().trim(),
author: item
.find(String.raw`dc\:creator`)
.text()
.trim(),
pubDate: parseDate(item.find('pubDate').text().trim()),
description: item.find(String.raw`content\:encoded`).text().trim(),
description: item
.find(String.raw`content\:encoded`)
.text()
.trim(),
};
});

View File

@ -85,7 +85,9 @@ async function handler(ctx) {
return {
title: 'SupChina - Podcasts',
link: `${rootUrl}/podcasts`,
itunes_author: $(String.raw`channel itunes\:author`).first().text(),
itunes_author: $(String.raw`channel itunes\:author`)
.first()
.text(),
image: $(String.raw`itunes\:image`).attr('href'),
item: items,
};