fix(route): 日本経済新聞News (#15170)

* fix nikkei/news

* fix import
This commit is contained in:
LMark 2024-04-09 20:54:52 +08:00 committed by GitHub
parent e8ab6beadf
commit 4bd6ab2ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 15 deletions

View File

@ -14,14 +14,6 @@ export const route: Route = {
categories: ['traditional-media'],
example: '/nikkei/news',
parameters: { category: 'Category, see table below', article_type: 'Only includes free articles, set `free` to enable, disabled by default' },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['www.nikkei.com/:category/archive', 'www.nikkei.com/:category'],
@ -29,7 +21,7 @@ export const route: Route = {
},
],
name: 'News',
maintainers: ['Arracc'],
maintainers: ['Arracc', 'ladeng07'],
handler,
description: `| 総合 | オピニオン | 経済 | 政治 | 金融 | マーケット | ビジネス | マネーのまなび | テック | 国際 | スポーツ | 社会・調査 | 地域 | 文化 | ライフスタイル |
| ---- | ---------- | ------- | -------- | --------- | ---------- | -------- | -------------- | ---------- | ------------- | -------- | ---------- | ----- | ------- | -------------- |
@ -47,18 +39,18 @@ async function handler(ctx) {
const $ = load(data);
let categoryName = '';
const listSelector = $('div#CONTENTS_MAIN').children('div.m-miM09').not('.PRa');
const paidSelector = 'span.m-iconMember';
const listSelector = $('[class^="container_"] [class^="default_"]:has(article)');
const paidSelector = 'img[class^="icon_"]';
let list = listSelector.toArray().map((item) => {
item = $(item);
item.find('p a').remove();
return {
title: item.find('.m-miM09_titleL').text(),
link: `${baseUrl}${item.find('.m-miM09_title a').attr('href')}`,
image: item.find('.m-miM09_thumb img').removeAttr('style').removeAttr('width').removeAttr('height').parent().html(),
title: item.find('[class^="titleLink_"]').text(),
link: `${baseUrl}${item.find('[class^="title_"] a').attr('href')}`,
image: item.find('[class^="image_"] img').removeAttr('style').removeAttr('width').removeAttr('height').parent().html(),
category: item
.find('.m-miM09_keyword a')
.find('[class^="topicItem_"] a')
.toArray()
.map((item) => $(item).text()),
paywall: !!item.find(paidSelector).length,