parent
710d32f4f3
commit
1d8357a377
|
|
@ -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],
|
||||
})),
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue