/
live.ts
59 lines (53 loc) · 1.7 KB
/
live.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { Route } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { art } from '@/utils/render';
import path from 'node:path';
const baseUrl = 'https://www.gelonghui.com';
export const route: Route = {
path: '/live',
categories: ['finance'],
example: '/gelonghui/live',
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['gelonghui.com/live', 'gelonghui.com/'],
},
],
name: '实时快讯',
maintainers: [],
handler,
url: 'gelonghui.com/live',
};
async function handler() {
const apiUrl = `${baseUrl}/api/live-channels/all/lives/v4`;
const {
data: { result },
} = await got(apiUrl);
const items = result.map((i) => ({
title: i.title || i.content,
description: art(path.join(__dirname, 'templates/live.art'), {
i,
}),
link: i.route,
category: i.source,
pubDate: parseDate(i.createTimestamp, 'X'),
}));
return {
title: '格隆汇快讯-7x24小时市场快讯-财经市场热点',
description: '格隆汇快讯栏目提供外汇投资实时行情,外汇投资交易,外汇投资炒股,证券等内容,实时更新,格隆汇未来将陆续开通台湾、日本、印度、欧洲等市场.',
image: 'https://cdn.gelonghui.com/static/web/www.ico.la.ico',
link: `${baseUrl}/live`,
item: items,
};
}