feat(route): add QuestMobile行业研究报告 (#7552)

This commit is contained in:
Ethan Shen
2021-11-27 14:29:57 +08:00
committed by GitHub
parent e48858d59f
commit ecd79514b1
3 changed files with 205 additions and 0 deletions

View File

@@ -621,6 +621,86 @@ IPFS 网关有可能失效,那时候换成其他网关。
<Route author="emdoe" example="/quantamagazine/archive" path="/quantamagazine/archive"/> <Route author="emdoe" example="/quantamagazine/archive" path="/quantamagazine/archive"/>
## QuestMobile
### 行业研究报告
<Route author="nczitzk" example="/questmobile/report" path="/questmobile/report/:category?/:label?" :paramsDesc="['行业,见下表,默认为全部行业', '标签,见下表,默认为全部标签']">
行业
| 全部行业 | 移动视频 | 移动社交 | 移动购物 |
| -------- | -------- | -------- | -------- |
| 0 | 10 | 1 | 2 |
| 系统工具 | 新闻资讯 | 移动音乐 | 生活服务 |
| -------- | -------- | -------- | -------- |
| 17 | 21 | 11 | 5 |
| 数字阅读 | 汽车服务 | 拍摄美化 | 旅游服务 |
| -------- | -------- | -------- | -------- |
| 16 | 4 | 12 | 8 |
| 健康美容 | 医疗服务 | 教育学习 | 金融理财 |
| -------- | -------- | -------- | -------- |
| 22 | 23 | 14 | 3 |
| 办公商务 | 智能设备 | 手机游戏 | 出行服务 | 内容平台 |
| -------- | -------- | -------- | -------- | -------- |
| 9 | 19 | 20 | 26 | 29 |
标签
| 全部标签 | 5G | 双十一 | 直播带货 | 电商平台 |
| -------- | -- | ------ | -------- | -------- |
| 0 | 75 | 74 | 73 | 72 |
| 新蓝领 | 市场竞争 | KOL | 品牌营销 | 互联网研究 |
| ------ | -------- | --- | -------- | ---------- |
| 71 | 70 | 69 | 68 | 67 |
| 广告效果 | 媒介策略 | App 和小程序 | App 增长 |
| -------- | -------- | ------------ | -------- |
| 66 | 65 | 64 | 63 |
| 小程序数据 | 移动大数据 | 互联网报告 | 数据报告 |
| ---------- | ---------- | ---------- | -------- |
| 62 | 61 | 60 | 59 |
| 互联网数据 | 智能终端 | 小程序 | 私域流量 |
| ---------- | -------- | ------ | -------- |
| 58 | 57 | 56 | 55 |
| 运动消费 | 用户争夺 | 运动健身 | 新消费 |
| -------- | -------- | -------- | ------ |
| 54 | 53 | 52 | 48 |
| 增长模式 | 下沉 | 新中产 | 银发族 |
| -------- | ---- | ------ | ------ |
| 42 | 41 | 36 | 31 |
| 粉丝经济 | 泛娱乐 | 网购少女 | 二次元 |
| -------- | ------ | -------- | ------ |
| 30 | 29 | 28 | 27 |
| 兴趣圈层 | 大学生 | 广告营销 | Z 世代 |
| -------- | ------ | -------- | ------ |
| 26 | 25 | 23 | 22 |
| 付费用户 | 精细化运营 | 00 后 | 90 后 |
| -------- | ---------- | ----- | ----- |
| 18 | 17 | 14 | 11 |
| 春节报告 | 低幼经济 | 季度报告 | 年度报告 |
| -------- | -------- | -------- | -------- |
| 10 | 9 | 7 | 6 |
| 全景生态 | 消费者洞察 |
| -------- | ---------- |
| 5 | 2 |
</Route>
## Readhub ## Readhub
### 分类 ### 分类

View File

@@ -4215,4 +4215,7 @@ router.get('/s-hentai/:id?', lazyloadRouteHandler('./routes/s-hentai'));
// Research Gate // Research Gate
router.get('/researchgate/publications/:id', require('./routes/researchgate/publications')); router.get('/researchgate/publications/:id', require('./routes/researchgate/publications'));
// QuestMobile
router.get('/questmobile/report/:category?/:label?', require('./routes/questmobile/report'));
module.exports = router; module.exports = router;

View File

@@ -0,0 +1,122 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const categories = {
0: '全部行业',
10: '移动视频',
1: '移动社交',
2: '移动购物',
17: '系统工具',
21: '新闻资讯',
11: '移动音乐',
5: '生活服务',
16: '数字阅读',
4: '汽车服务',
12: '拍摄美化',
8: '旅游服务',
22: '健康美容',
23: '医疗服务',
14: '教育学习',
3: '金融理财',
9: '办公商务',
19: '智能设备',
20: '手机游戏',
26: '出行服务',
29: '内容平台',
};
const labels = {
0: '全部标签',
75: '5G',
74: '双十一',
73: '直播带货',
72: '电商平台',
71: '新蓝领',
70: '市场竞争',
69: 'KOL',
68: '品牌营销',
67: '互联网研究',
66: '广告效果',
65: '媒介策略',
64: 'App和小程序',
63: 'App增长',
62: '小程序数据',
61: '移动大数据',
60: '互联网报告',
59: '数据报告',
58: '互联网数据',
57: '智能终端',
56: '小程序',
55: '私域流量',
54: '运动消费',
53: '用户争夺',
52: '运动健身',
48: '新消费',
42: '增长模式',
41: '下沉',
36: '新中产',
31: '银发族',
30: '粉丝经济',
29: '泛娱乐',
28: '网购少女',
27: '二次元',
26: '兴趣圈层',
25: '大学生',
23: '广告营销',
22: 'Z世代',
18: '付费用户',
17: '精细化运营',
14: '00后',
11: '90后',
10: '春节报告',
9: '低幼经济',
7: '季度报告',
6: '年度报告',
5: '全景生态',
2: '消费者洞察',
};
module.exports = async (ctx) => {
const category = ctx.params.category || '0';
const label = ctx.params.label || '0';
const rootUrl = 'https://www.questmobile.com.cn';
const currentUrl = `${rootUrl}/api/v1/research/reports?categoryId=${category}&labelId=${label}&version=0&currentPage=1&limit=15`;
const response = await got({
method: 'get',
url: currentUrl,
});
const list = response.data.data.map((item) => ({
title: item.title,
pubDate: Date.parse(item.publishTime),
link: `${rootUrl}/research/report-new/${item.id}/`,
}));
const items = await Promise.all(
list.map(
async (item) =>
await ctx.cache.tryGet(item.link, async () => {
const detailResponse = await got({
method: 'get',
url: item.link,
});
const content = cheerio.load(detailResponse.data);
content('img[_ngcontent-c11]').each(function () {
content(this).attr('alt', '');
});
item.description = content('.text').html();
return item;
})
)
);
ctx.state.data = {
title: `${categories[category]}, ${labels[label]} - 行业研究报告 - QuestMobile`,
link: currentUrl,
item: items,
};
};