From a8fdec66217a2b5758d826a2ef1d515f6b6148f4 Mon Sep 17 00:00:00 2001
From: Fatpandac <1779196284@qq.com>
Date: Wed, 2 Feb 2022 23:32:07 +0800
Subject: [PATCH] fix(route): zhihu/topic add type of the article (#8953)
---
lib/routes/zhihu/topic.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/routes/zhihu/topic.js b/lib/routes/zhihu/topic.js
index 14b00bd95..be34547d1 100644
--- a/lib/routes/zhihu/topic.js
+++ b/lib/routes/zhihu/topic.js
@@ -1,5 +1,6 @@
const got = require('@/utils/got');
const utils = require('./utils');
+const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const { topicId } = ctx.params;
@@ -32,7 +33,7 @@ module.exports = async (ctx) => {
title = `${item.question.title}-${item.author.name}的回答:${item.excerpt}`;
description = `${item.question.title}
${item.author.name}的回答
${utils.ProcessImage(item.content)}`;
link = `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`;
- pubDate = new Date(item.updated_time * 1000).toUTCString();
+ pubDate = parseDate(item.updated_time * 1000);
author = item.author.name;
break;
@@ -40,7 +41,14 @@ module.exports = async (ctx) => {
title = item.title;
description = item.title;
link = `https://www.zhihu.com/question/${item.id}`;
- pubDate = new Date(item.created * 1000).toUTCString();
+ pubDate = parseDate(item.created * 1000);
+ break;
+
+ case 'article':
+ title = item.title;
+ description = item.content;
+ link = item.url;
+ pubDate = parseDate(item.created * 1000);
break;
default: