feat: update diygod animal-crossing

This commit is contained in:
DIYgod 2020-03-28 05:21:04 +08:00
parent fd93be2498
commit 9710fde54e
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 3 additions and 2 deletions

View File

@ -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(),