From 998c8b14afdb8dce13ec57b1b6887dc2e7893600 Mon Sep 17 00:00:00 2001 From: maijver Date: Sat, 9 Jan 2021 12:17:17 +0800 Subject: [PATCH] add --- lib/routes/allnow/column.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/allnow/column.js b/lib/routes/allnow/column.js index 88d5a2c0b..c03a0c9f3 100644 --- a/lib/routes/allnow/column.js +++ b/lib/routes/allnow/column.js @@ -2,7 +2,7 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const rootUrl = 'https://m.allnow.com'; + const rootUrl = 'https://www.allnow.com'; const currentUrl = `${rootUrl}/column/${ctx.params.id}`; const response = await got({ method: 'get', @@ -10,7 +10,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const list = $('a.normal') + const list = $('.post-list .post') .slice(0, 10) .map((_, item) => { item = $(item); @@ -33,7 +33,7 @@ module.exports = async (ctx) => { item.title = content('p.title').text(); item.author = content('a.single-name').eq(0).text(); item.description = content('#article-content').html(); - item.pubDate = new Date(detailResponse.data.match(/time:"(.*)",abstract:"/)[1] + ' GMT+8').toUTCString(); + item.pubDate = new Date(detailResponse.data.match(/time:"(.*?)"\}/)[1] + ' GMT+8').toUTCString(); return item; })