mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
增加mobdata分析报告 (#1847)
This commit is contained in:
@@ -462,6 +462,10 @@ type 为 all 时,category 参数不支持 cost 和 free
|
|||||||
|
|
||||||
<route name="产业研究报告" author="brilon" example="/iresearch/report" path="/iresearch/report"/>
|
<route name="产业研究报告" author="brilon" example="/iresearch/report" path="/iresearch/report"/>
|
||||||
|
|
||||||
|
### MobData
|
||||||
|
|
||||||
|
<route name="分析报告" author="brilon" example="/mobdata/report" path="/mobdata/report"/>
|
||||||
|
|
||||||
### 腾讯谷雨
|
### 腾讯谷雨
|
||||||
|
|
||||||
<Route name="栏目" author="LogicJake" example="/tencent/guyu/channel/lab" path="/tencent/guyu/channel/:name" :paramsDesc="['栏目名称,包括lab,report,story,shalong']"/>
|
<Route name="栏目" author="LogicJake" example="/tencent/guyu/channel/lab" path="/tencent/guyu/channel/:name" :paramsDesc="['栏目名称,包括lab,report,story,shalong']"/>
|
||||||
|
|||||||
@@ -1217,6 +1217,9 @@ router.get('/infoq/topic/:id', require('./routes/infoq/topic'));
|
|||||||
// 艾瑞
|
// 艾瑞
|
||||||
router.get('/iresearch/report', require('./routes/iresearch/report'));
|
router.get('/iresearch/report', require('./routes/iresearch/report'));
|
||||||
|
|
||||||
|
// MobData
|
||||||
|
router.get('/mobdata/report', require('./routes/mobdata/report'));
|
||||||
|
|
||||||
// 谷雨
|
// 谷雨
|
||||||
router.get('/tencent/guyu/channel/:name', require('./routes/tencent/guyu/channel'));
|
router.get('/tencent/guyu/channel/:name', require('./routes/tencent/guyu/channel'));
|
||||||
|
|
||||||
|
|||||||
30
lib/routes/mobdata/report.js
Normal file
30
lib/routes/mobdata/report.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
const axios = require('../../utils/axios');
|
||||||
|
const date = require('../../utils/date');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const apiUrl = 'http://admin.mob.com/api/mobdata/report/list';
|
||||||
|
const pageUrl = 'http://mobdata.mob.com/mobdata/report';
|
||||||
|
|
||||||
|
const resp = await axios({
|
||||||
|
method: 'post',
|
||||||
|
url: apiUrl,
|
||||||
|
headers: {
|
||||||
|
Referer: pageUrl,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = resp.data.list;
|
||||||
|
const items = list.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
description: `${item.desc}<br><a href="${item.report_path}">查看报告</a>`,
|
||||||
|
pubDate: date(item.created_at),
|
||||||
|
link: item.report_path,
|
||||||
|
}));
|
||||||
|
ctx.state.data = {
|
||||||
|
title: 'MobData分析报告',
|
||||||
|
link: pageUrl,
|
||||||
|
description: 'MobData分析报告',
|
||||||
|
item: items,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user