fix: 中国人大网 (#5907)

Co-authored-by: Tecent Cloud <work01@233yeee.com>
This commit is contained in:
233yeee
2020-10-18 16:38:50 +01:00
committed by GitHub
co-authored by Tecent Cloud
parent 710d32f4f3
commit 1d8357a377
+2 -2
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],
})),
};