mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
feat(route): add 人民网领导留言板 (#8285)
This commit is contained in:
@@ -1036,7 +1036,7 @@ category 对应的关键词有
|
|||||||
|
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
## 人民日报
|
## 人民网
|
||||||
|
|
||||||
### 观点
|
### 观点
|
||||||
|
|
||||||
@@ -1054,9 +1054,7 @@ category 对应的关键词有
|
|||||||
|
|
||||||
<Route author="nczitzk" example="/people/cpc/24h" path="/people/cpc/24h"/>
|
<Route author="nczitzk" example="/people/cpc/24h" path="/people/cpc/24h"/>
|
||||||
|
|
||||||
## 人民日报社 国际金融报
|
### 国际金融报栏目
|
||||||
|
|
||||||
### 栏目
|
|
||||||
|
|
||||||
<Route author="Origami404" example="/ifnews/48" path="/ifnews/:cid" :paramsDesc="['栏目 ID']">
|
<Route author="Origami404" example="/ifnews/48" path="/ifnews/:cid" :paramsDesc="['栏目 ID']">
|
||||||
|
|
||||||
@@ -1064,6 +1062,16 @@ category 对应的关键词有
|
|||||||
|
|
||||||
</Route>
|
</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