/
golden.ts
32 lines (28 loc) · 943 Bytes
/
golden.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Route } from '@/types';
import got from '@/utils/got';
export const route: Route = {
path: '/golden',
categories: ['program-update'],
example: '/mi/golden',
name: '小米应用商店金米奖',
maintainers: ['nczitzk'],
handler,
};
async function handler() {
const link = 'https://app.market.xiaomi.com/apm/subject/169449?os=1.1.1&sdk=19';
const response = await got({
method: 'get',
url: link,
});
const list = response.data.listApp.map((item) => ({
title: `第${item.subjectGroup.split('期')[0].replace('第', '')}期 ${item.displayName} [${item.level1CategoryName} - ${item.level2CategoryName}]`,
link: `http://app.mi.com/details?id=${item.packageName}`,
description: item.briefShow,
}));
return {
title: `金米奖 - 小米应用商店`,
link,
item: list,
description: response.data.description,
};
}