mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix: 読売新聞, add title tag (#5825)
This commit is contained in:
@@ -259,6 +259,8 @@ Category 列表:
|
||||
|
||||
<Route author="Arracc" example="/yomiuri/news" path="/yomiuri/:category" :paramsDesc="['分类']">
|
||||
|
||||
无料全文,综合页添加分类标签,可用于过滤。
|
||||
|
||||
| 総合 | 社会 | 政治 | 経済 | スポーツ | 国際 | 科学・IT | 選挙・世論調査 | エンタメ・文化 | 囲碁・将棋 | ライフ | 地域 | 社説 |
|
||||
| ---- | -------- | -------- | ------- | -------- | ----- | ---------- | -------------- | -------------- | ---------- | ------ | ----- | --------- |
|
||||
| news | national | politics | economy | sports | world | science | election | culture | igoshougi | life | local | editorial |
|
||||
|
||||
+1
-1
@@ -3314,7 +3314,7 @@ router.get('/nobelprize/:caty?', require('./routes/nobelprize/index'));
|
||||
router.get('/gov/taiwan/mnd', require('./routes/gov/taiwan/mnd'));
|
||||
|
||||
// 読売新聞
|
||||
router.get('/yomiuri/:category?', require('./routes/yomiuri/news'));
|
||||
router.get('/yomiuri/:category', require('./routes/yomiuri/news'));
|
||||
|
||||
// 巴哈姆特
|
||||
// GNN新闻
|
||||
|
||||
@@ -32,8 +32,30 @@ module.exports = async (ctx) => {
|
||||
const $ = cheerio.load(response.data);
|
||||
return $('div.p-main-contents').html();
|
||||
});
|
||||
let tag = '';
|
||||
if (category_name === '総合') {
|
||||
const tag_table = {
|
||||
news: '総合',
|
||||
national: '社会',
|
||||
politics: '政治',
|
||||
economy: '経済',
|
||||
sports: 'スポーツ',
|
||||
world: '国際',
|
||||
science: '科学・IT',
|
||||
election: '選挙・世論調査',
|
||||
culture: 'エンタメ・文化',
|
||||
igoshougi: '囲碁・将棋',
|
||||
life: 'ライフ',
|
||||
local: '地域',
|
||||
editorial: '社説',
|
||||
medical: '医療・健康',
|
||||
};
|
||||
const tag_value = tag_table[link.split('/')[3]];
|
||||
tag = tag_value ? tag_value : 'その他';
|
||||
tag = '[' + tag + '] ';
|
||||
}
|
||||
return {
|
||||
title: item.find('a').text(),
|
||||
title: tag + item.find('a').text(),
|
||||
description,
|
||||
link,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user