style: auto format
This commit is contained in:
parent
9268d27e00
commit
9c9e3d4d6d
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue