feat(route): add route for Ke Research Institute (#11714)
* feat(route): add route for Ke Research Institute Signed-off-by: shaomingbo <shaomingbo@hotmail.com> * Update lib/v2/ke/results.js refactor: replace string template to normal string * Update lib/v2/ke/results.js refactor: replace string template to normal string * refactor: docs format Signed-off-by: shaomingbo <shaomingbo@hotmail.com> * Update lib/v2/ke/results.js --------- Signed-off-by: shaomingbo <shaomingbo@hotmail.com>
This commit is contained in:
@@ -1003,3 +1003,9 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
### はてな匿名ダイアリー - 人気記事アーカイブ
|
||||
|
||||
<Route author="masakichi" example="/hatena/anonymous_diary/archive" path="/hatena/anonymous_diary/archive"/>
|
||||
|
||||
## 贝壳研究院
|
||||
|
||||
### 研究成果
|
||||
|
||||
<Route author="shaomingbo" example="/ke/researchResults" path="/ke/researchResults" radar="1"/>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
'/researchResults': ['shaomingbo'],
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
'research.ke.com': {
|
||||
_name: '贝壳研究院 - 房地产行业研究报告',
|
||||
www: [
|
||||
{
|
||||
title: '研究成果',
|
||||
docs: 'https://docs.rsshub.app/other.html#bei-ke-yan-jiu-yuan',
|
||||
source: ['/researchResults'],
|
||||
target: '/researchResults',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got({
|
||||
method: 'post',
|
||||
url: 'https://research.ke.com/apis/consumer-access/index/contents/page',
|
||||
headers: {
|
||||
Referer: 'https://research.ke.com/ResearchResults',
|
||||
},
|
||||
json: {
|
||||
pageIndex: 1,
|
||||
pageSize: 9,
|
||||
},
|
||||
});
|
||||
|
||||
const { status, statusMessage } = response;
|
||||
if (status !== 200) {
|
||||
throw new Error(statusMessage);
|
||||
}
|
||||
|
||||
const { list } = response.data.data;
|
||||
|
||||
ctx.state.data = {
|
||||
title: '房地产行业研究报告',
|
||||
link: 'https://research.ke.com/ResearchResults',
|
||||
description: '研究成果',
|
||||
item: list.map((item) => ({
|
||||
title: item.title,
|
||||
link: `https://research.ke.com/${item.contentTypeId}/ArticleDetail?id=${item.id}`,
|
||||
author: item.author,
|
||||
description: item.guideReading,
|
||||
pubDate: parseDate(item.publishTime),
|
||||
})),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = function (router) {
|
||||
router.get('/researchResults', require('./results'));
|
||||
};
|
||||
Reference in New Issue
Block a user