From 9710fde54e5ed880084e9b3f7d5f00a79f0002b8 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 28 Mar 2020 05:21:04 +0800 Subject: [PATCH] feat: update diygod animal-crossing --- lib/routes/blogs/diygod/animal-crossing.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routes/blogs/diygod/animal-crossing.js b/lib/routes/blogs/diygod/animal-crossing.js index 4c31dee85..9ced1d3d9 100644 --- a/lib/routes/blogs/diygod/animal-crossing.js +++ b/lib/routes/blogs/diygod/animal-crossing.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const list = $('h3'); + const list = $('h2'); ctx.state.data = { title: 'DIYgod 的动森日记', @@ -22,7 +22,7 @@ module.exports = async (ctx) => { .map((index, item) => { item = $(item); let description = ''; - item.nextUntil('h3').each((index, item) => { + item.nextUntil('h2').each((index, item) => { description += $(item).html(); }); return { @@ -30,6 +30,7 @@ module.exports = async (ctx) => { description, link: `https://diygod.me/animal-crossing/#${item.attr('id')}`, pubDate: date(item.text().split(' ')[1]), + guid: item.text().split(' ')[0], }; }) .get(),