rsshub
Version:
Make RSS Great Again!
84 lines (82 loc) • 2.53 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import { t as ViewType } from "./types-gOySfSXJ.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.mjs";
import "./is-worker-DESPicPc.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import "./timezone-CA9Huotp.mjs";
import { t as parseItem } from "./utils-Bipj3zdF.mjs";
//#region lib/routes/gelonghui/home.ts
const route = {
path: "/home/:tag?",
categories: ["finance"],
view: ViewType.Articles,
example: "/gelonghui/home",
parameters: { tag: {
description: "分类标签,见下表,默认为 `web_home_page`",
options: [
{
value: "web_home_page",
label: "推荐"
},
{
value: "stock",
label: "股票"
},
{
value: "fund",
label: "基金"
},
{
value: "new_stock",
label: "新股"
},
{
value: "research",
label: "研报"
}
]
} },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "首页",
maintainers: ["TonyRL"],
handler,
description: `| 推荐 | 股票 | 基金 | 新股 | 研报 |
| --------------- | ----- | ---- | ---------- | -------- |
| web_home_page | stock | fund | new_stock | research |`
};
async function handler(ctx) {
const { tag = "web_home_page" } = ctx.req.param();
const { data } = await got_default(`https://www.gelonghui.com/api/channels/${tag}/articles/v8`);
const list = data.result.map((article) => {
article = article.data;
return {
title: article.title,
description: article.summary,
link: article.link,
author: article.nick,
category: article.source,
pubDate: parseDate(article.timestamp, "X")
};
});
return {
title: "格隆汇-财经资讯动态-股市行情",
description: "格隆汇为中国投资者出海投资及中国公司出海融资,提供海外投资,港股开户行情,科创板股票发行数据、资讯、研究、交易等一站式服务,目前业务范围主要涉及港股与美股两大市场,未来将陆续开通台湾、日本、印度、欧洲等市场.",
image: "https://cdn.gelonghui.com/static/web/www.ico.la.ico",
link: "https://www.gelonghui.com",
item: await Promise.all(list.map((item) => parseItem(item, cache_default.tryGet)))
};
}
//#endregion
export { route };