From b273cf07504fce42fb9b73487ce2c9547dbc1a7f Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:43:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E7=8E=AF=E7=90=83=E7=BD=91=20Pub?= =?UTF-8?q?date=20(#10826)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/v2/huanqiu/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/v2/huanqiu/index.js b/lib/v2/huanqiu/index.js index e08ca376b43e8..17b8a672a83e5 100644 --- a/lib/v2/huanqiu/index.js +++ b/lib/v2/huanqiu/index.js @@ -1,7 +1,6 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); -const timezone = require('@/utils/timezone'); function getKeysRecursive(dic, key, attr, array) { Object.values(dic).forEach((v) => { @@ -47,9 +46,12 @@ module.exports = async (ctx) => { url: item.link, }); const content = cheerio.load(detailResponse.data); + item.description = content('textarea.article-content').text(); item.author = content('span', '.source').text(); - item.pubDate = timezone(parseDate(content('p.time').text()), +8); + item.pubDate = parseDate(parseInt(content('textarea.article-time').text())); + item.category = content('meta[name="keywords"]').attr('content').split(','); + return item; }) )