fix: gbcc/trust GUIDs are not unique (#3747)

This commit is contained in:
Henry Wang
2020-01-16 14:21:06 +08:00
committed by DIYgod
parent 252f314a19
commit d516472f83
+11 -9
View File
@@ -8,15 +8,17 @@ module.exports = async (ctx) => {
const $ = cheerio.load(response);
const items = $('.entry-anchorLinkId')
.next('.entry-text')
.map((i, e) => ({
title: $(e)
.find('h1')
.html(),
link,
description: $(e).html(),
pubDate: new Date().toUTCString(),
}))
.map((i, e) => {
const text = $(e).next('.entry-text');
return {
title: $(text)
.find('h1')
.html(),
link: `${link}#${$(e).children('div')[0].attribs.id}`,
description: $(text).html(),
pubDate: new Date().toUTCString(),
};
})
.get();
ctx.state.data = {