mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -18,7 +18,7 @@ module.exports = async (ctx) => {
|
||||
const relativePath = ele.attr('href');
|
||||
const innerText = ele.text();
|
||||
const link = url.resolve(indexLink, relativePath);
|
||||
const cache = ctx.cache.get(link);
|
||||
const cache = await ctx.cache.get(link);
|
||||
if (cache) {
|
||||
return cache;
|
||||
}
|
||||
@@ -32,13 +32,15 @@ module.exports = async (ctx) => {
|
||||
description = sanitizeHtml(description, {
|
||||
allowedTags: ['section', 'h2', 'ul', 'li', 'p', 'span', 'a'],
|
||||
});
|
||||
return {
|
||||
const item = {
|
||||
title: $('head>title').text(),
|
||||
pubDate: new Date(innerText.trim()).toUTCString(),
|
||||
description,
|
||||
guid: link,
|
||||
link,
|
||||
};
|
||||
await ctx.cache.set(link, cache, 24 * 60 * 60);
|
||||
return item;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
|
||||
Reference in New Issue
Block a user