From cdcb2e580bd9989f1a57574aa48be2c2693a006d Mon Sep 17 00:00:00 2001 From: hongfei Date: Mon, 28 Feb 2022 20:30:45 -0500 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E4=BF=AE=E5=A4=8D=E7=9F=A5?= =?UTF-8?q?=E4=B9=8E=E5=88=86=E7=B1=BB=E7=83=AD=E6=A6=9C=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=20(#9220)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FIX] fix zhihu url * fix: use parseDate utils Co-authored-by: Hongfei Zhou --- lib/routes/zhihu/hot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/routes/zhihu/hot.js b/lib/routes/zhihu/hot.js index 2a35d244a..819a18d66 100644 --- a/lib/routes/zhihu/hot.js +++ b/lib/routes/zhihu/hot.js @@ -1,4 +1,5 @@ const got = require('@/utils/got'); +const { parseDate } = require('@/utils/parse-date'); const titles = { total: '全站', @@ -23,9 +24,9 @@ module.exports = async (ctx) => { }); const items = response.data.data.map((item) => ({ - link: item.target.url, + link: `https://www.zhihu.com/question/${item.target.id}`, title: item.target.title, - pubDate: new Date(item.target.created * 1000).toUTCString(), + pubDate: parseDate(item.target.created * 1000), description: item.target.excerpt ? `

${item.target.excerpt}

` : '', }));