rsshub
Version:
Make RSS Great Again!
74 lines (72 loc) • 2.19 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.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 md5 } from "./md5-C8GRvctM.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { t as timezone } from "./timezone-D8cuwzTY.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/cebbank/all.ts
init_esm_shims();
const route = {
path: "/quotation/all",
categories: ["other"],
example: "/cebbank/quotation/all",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: [
"cebbank.com/site/ygzx/whpj/index.html",
"cebbank.com/eportal/ui",
"cebbank.com/"
] }],
name: "Unknown",
maintainers: ["linbuxiao"],
handler,
url: "cebbank.com/site/ygzx/whpj/index.html"
};
async function handler(ctx) {
const link = "https://www.cebbank.com/eportal/ui?pageId=477257";
const $ = load((await got_default({
method: "get",
url: link
})).data);
const ret = {
title: "中国光大银行",
description: "中国光大银行 外汇牌价",
link,
item: $(".lczj_box tbody tr").toArray().map((e, i) => {
if (i < 2) return null;
const c = load(e, { decodeEntities: false });
return {
title: c("td:nth-child(1)").text(),
description: art(path.join(__dirname, "templates/allDes-179f1873.art"), {
fcer: c("td:nth-child(2)").text(),
pmc: c("td:nth-child(3)").text(),
exrt: c("td:nth-child(4)").text(),
mc: c("td:nth-child(5)").text()
}),
pubDate: timezone(parseDate($("#t_id span").text().slice(5), "YYYY-MM-DD HH:mm", true), 8),
guid: md5(c("td:nth-child(1)").text() + $("#t_id span").text().slice(5))
};
})
};
ctx.set("json", {
...ret,
pubDate: timezone(parseDate($("#t_id span").text().slice(5), "YYYY-MM-DD HH:mm", true), 0)
});
return ret;
}
//#endregion
export { route };