fix: 中国人大网 (#5907)

Co-authored-by: Tecent Cloud <work01@233yeee.com>
This commit is contained in:
233yeee 2020-10-18 23:38:50 +08:00 committed by GitHub
parent 710d32f4f3
commit 1d8357a377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ module.exports = async (ctx) => {
const links = $('.clist a')
.map((index, item) => [$(item).attr('href')])
.get();
// 获取标题、日期
// 获取标题、日期、内容
const list = await Promise.all(
links.map(async (link) => {
const response = await got(`http://www.npc.gov.cn${link}`);
@ -35,7 +35,7 @@ module.exports = async (ctx) => {
item: list.map((item) => ({
title: item[0],
link: `http://www.npc.gov.cn${item[1]}`,
pubDate: new Date(item[2].substr(0, 4), parseInt(item[2].substr(5, 2)) - 1, item[2].substr(8, 2), item[2].substr(12, 2), item[2].substr(15, 2), item[2].substr(18, 2)).toUTCString(),
pubDate: new Date(Date.parse(item[2].replace(/[年月日]/g, '/'))).toUTCString(),
description: item[3],
})),
};