UNPKG

rsshub

Version:
84 lines (82 loc) 2.53 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import { t as ViewType } from "./types-D84BRIt4.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import "./timezone-D8cuwzTY.mjs"; import { t as parseItem } from "./utils-D2tHMe1W.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 };