diff --git a/docs/other.md b/docs/other.md index c4c0b539e..b612a8da7 100644 --- a/docs/other.md +++ b/docs/other.md @@ -1003,3 +1003,9 @@ type 为 all 时,category 参数不支持 cost 和 free ### はてな匿名ダイアリー - 人気記事アーカイブ + +## 贝壳研究院 + +### 研究成果 + + diff --git a/lib/v2/ke/maintainer.js b/lib/v2/ke/maintainer.js new file mode 100644 index 000000000..f6ffb911e --- /dev/null +++ b/lib/v2/ke/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/researchResults': ['shaomingbo'], +}; diff --git a/lib/v2/ke/radar.js b/lib/v2/ke/radar.js new file mode 100644 index 000000000..37d587ea9 --- /dev/null +++ b/lib/v2/ke/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/ke/results.js b/lib/v2/ke/results.js new file mode 100644 index 000000000..779102be6 --- /dev/null +++ b/lib/v2/ke/results.js @@ -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), + })), + }; +}; diff --git a/lib/v2/ke/router.js b/lib/v2/ke/router.js new file mode 100644 index 000000000..51749f41c --- /dev/null +++ b/lib/v2/ke/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/researchResults', require('./results')); +};