mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
feat: use contentExpire
This commit is contained in:
@@ -6,37 +6,33 @@ const ProcessFeed = async (list, cache) => {
|
||||
const items = await Promise.all(
|
||||
list.map(async (e) => {
|
||||
const uuid = e.uuid;
|
||||
const single = await cache.tryGet(
|
||||
uuid,
|
||||
async () => {
|
||||
const link = `https://www.infoq.cn/article/${uuid}`;
|
||||
const resp = await axios({
|
||||
method: 'post',
|
||||
url: detailUrl,
|
||||
headers: {
|
||||
Referer: link,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: {
|
||||
uuid: uuid,
|
||||
},
|
||||
});
|
||||
const single = await cache.tryGet(uuid, async () => {
|
||||
const link = `https://www.infoq.cn/article/${uuid}`;
|
||||
const resp = await axios({
|
||||
method: 'post',
|
||||
url: detailUrl,
|
||||
headers: {
|
||||
Referer: link,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: {
|
||||
uuid: uuid,
|
||||
},
|
||||
});
|
||||
|
||||
const data = resp.data.data;
|
||||
const author = data.author ? data.author.map((p) => p.nickname).join(',') : data.no_author;
|
||||
const pubDate = new Date();
|
||||
pubDate.setTime(data.publish_time);
|
||||
const data = resp.data.data;
|
||||
const author = data.author ? data.author.map((p) => p.nickname).join(',') : data.no_author;
|
||||
const pubDate = new Date();
|
||||
pubDate.setTime(data.publish_time);
|
||||
|
||||
return {
|
||||
title: data.article_title,
|
||||
description: data.content,
|
||||
pubDate,
|
||||
author: author,
|
||||
link,
|
||||
};
|
||||
},
|
||||
2 * 24 * 60 * 60
|
||||
);
|
||||
return {
|
||||
title: data.article_title,
|
||||
description: data.content,
|
||||
pubDate,
|
||||
author: author,
|
||||
link,
|
||||
};
|
||||
});
|
||||
|
||||
return Promise.resolve(single);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user