mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 04:11:26 +08:00
feat(route): add 人民网领导留言板 (#8285)
This commit is contained in:
@@ -1036,27 +1036,25 @@ category 对应的关键词有
|
||||
|
||||
</Route>
|
||||
|
||||
## 人民日报
|
||||
## 人民网
|
||||
|
||||
### 观点
|
||||
|
||||
<Route author="LogicJake" example="/people/opinion/223228" path="/people/opinion/:id" :paramsDesc="['板块 id,可在 URL 中找到']"/>
|
||||
<Route author="LogicJake" example="/people/opinion/223228" path="/people/opinion/:id" :paramsDesc="['板块 id,可在 URL 中找到']"/>
|
||||
|
||||
### 环保频道
|
||||
|
||||
<Route author="zsimple" example="/people/env/74877" path="/people/env/:id" :paramsDesc="['板块 id,可在 URL 中找到']"/>
|
||||
<Route author="zsimple" example="/people/env/74877" path="/people/env/:id" :paramsDesc="['板块 id,可在 URL 中找到']"/>
|
||||
|
||||
### 习近平系列重要讲话
|
||||
|
||||
<Route author="LogicJake" example="/people/xjpjh" path="/people/xjpjh/:keyword?/:year?" :paramsDesc="['关键词,默认不填','年份,默认 all']"/>
|
||||
<Route author="LogicJake" example="/people/xjpjh" path="/people/xjpjh/:keyword?/:year?" :paramsDesc="['关键词,默认不填','年份,默认 all']"/>
|
||||
|
||||
### 中国共产党新闻网 24 小时滚动新闻
|
||||
|
||||
<Route author="nczitzk" example="/people/cpc/24h" path="/people/cpc/24h"/>
|
||||
|
||||
## 人民日报社 国际金融报
|
||||
|
||||
### 栏目
|
||||
### 国际金融报栏目
|
||||
|
||||
<Route author="Origami404" example="/ifnews/48" path="/ifnews/:cid" :paramsDesc="['栏目 ID']">
|
||||
|
||||
@@ -1064,6 +1062,16 @@ category 对应的关键词有
|
||||
|
||||
</Route>
|
||||
|
||||
### 领导留言板
|
||||
|
||||
<Route author="nczitzk" example="/people/liuyan/539" path="/people/liuyan/:id/:state?" :paramsDesc="['编号,可在对应人物页 URL 中找到', '状态,见下表,默认为全部']">
|
||||
|
||||
| 全部 | 待回复 | 办理中 | 已办理 |
|
||||
| ---- | ------ | ------ | ------ |
|
||||
| 1 | 2 | 3 | 4 |
|
||||
|
||||
</Route>
|
||||
|
||||
## 日本経済新聞
|
||||
|
||||
### ホームページ
|
||||
|
||||
54
lib/v2/people/liuyan.js
Normal file
54
lib/v2/people/liuyan.js
Normal file
@@ -0,0 +1,54 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const fid = ctx.params.id;
|
||||
const state = ctx.params.state ?? '1';
|
||||
|
||||
const rootUrl = 'http://liuyan.people.com.cn';
|
||||
const currentUrl = `${rootUrl}/threads/list?fid=${fid}#state=${state}`;
|
||||
|
||||
let currentForum;
|
||||
|
||||
const apiResponse = await got({
|
||||
method: 'post',
|
||||
url: `${rootUrl}/threads/queryThreadsList`,
|
||||
form: {
|
||||
fid,
|
||||
state,
|
||||
lastItem: 0,
|
||||
},
|
||||
});
|
||||
|
||||
const list = apiResponse.data.responseData.map((item) => ({
|
||||
title: item.subject,
|
||||
author: item.nickName,
|
||||
link: `${rootUrl}/threads/content?tid=${item.tid}`,
|
||||
pubDate: parseDate(item.threadsCheckTime * 1000),
|
||||
}));
|
||||
|
||||
const items = await Promise.all(
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link,
|
||||
});
|
||||
|
||||
const content = cheerio.load(detailResponse.data);
|
||||
|
||||
item.description = content('.content').html();
|
||||
currentForum = currentForum ?? content('#currentForum').text();
|
||||
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${currentForum} - 领导留言板 - 人民网`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
3
lib/v2/people/maintainer.js
Normal file
3
lib/v2/people/maintainer.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/liuyan/:id/:state?': ['nczitzk'],
|
||||
};
|
||||
13
lib/v2/people/radar.js
Normal file
13
lib/v2/people/radar.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'people.com': {
|
||||
_name: '人民网',
|
||||
liuyan: [
|
||||
{
|
||||
title: '领导留言板',
|
||||
docs: 'https://docs.rsshub.app/traditional-media.html#ren-min-wang-ling-dao-liu-yan-ban',
|
||||
source: '/',
|
||||
target: '/people/liuyan/:id/:state?',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
3
lib/v2/people/router.js
Normal file
3
lib/v2/people/router.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/liuyan/:id/:state?', require('./liuyan'));
|
||||
};
|
||||
Reference in New Issue
Block a user