fix(route)(fortunechina): 修正财富中文网日期时间匹配规则、移除一些不必要评论元素 (#9464)

This commit is contained in:
任平生
2022-04-04 23:26:36 +08:00
committed by GitHub
parent 32fe3aeb65
commit 6835353052
+3 -3
View File
@@ -41,9 +41,9 @@ module.exports = async (ctx) => {
const content = cheerio.load(detailResponse.data);
const spans = content('.mod-info span').text();
let matches = spans.match(/(\d{4}年\d{2}月\d{2}日)/);
let matches = spans.match(/(\d{4}-\d{2}-\d{2})/);
if (matches) {
item.pubDate = parseDate(matches[1].replace(/年|月/g, '-').replace(/日/, ''));
item.pubDate = parseDate(matches[1]);
} else {
matches = spans.match(/(\d+小时前)/);
if (matches) {
@@ -53,7 +53,7 @@ module.exports = async (ctx) => {
item.author = content('.name').text();
content('.mod-info, .title').remove();
content('.mod-info, .title, .eval-zan, .eval-pic, .sae-more').remove();
item.description = content('#articleContent, .eval-desc').html();