mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-29 16:07:42 +08:00
fix(route)(fortunechina): 修正财富中文网日期时间匹配规则、移除一些不必要评论元素 (#9464)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user