rsshub
Version:
Make RSS Great Again!
62 lines (60 loc) • 2.12 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 cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/chaincatcher/home.ts
init_esm_shims();
const rootUrl = "https://www.chaincatcher.com";
const route = {
path: "/",
radar: [{
source: ["chaincatcher.com/"],
target: ""
}],
name: "Unknown",
maintainers: ["TonyRL"],
handler,
url: "chaincatcher.com/"
};
async function handler() {
const { data } = await got_default.post(`${rootUrl}/api/article/lists`, { form: {
page: 1,
home: 1
} });
const list = data.data.map((item) => ({
title: item.title,
description: item.description,
link: `${rootUrl}/article/${item.id}`,
pubDate: parseDate(item.add_time, "X"),
categoryId: item.categoryid,
category: [...item.keywords.split(","), item.category_name]
}));
const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
if (item.categoryId !== 3) {
const { data: response } = await got_default(item.link);
const $ = load(response);
item.description = art(path.join(__dirname, "templates/home-8889eee2.art"), {
summary: item.description,
article: $(".article-container").html()
});
}
return item;
})));
return {
title: "链捕手ChainCatcher — 专业的区块链技术研究与资讯平台-Chain Catcher",
description: "链捕手ChainCatcher为区块链技术爱好者与项目决策者提供NFT、Web3社交、DID、Layer2等专业的资讯与研究内容,Chain Catcher输出对Scroll、Sui、Aptos、ENS等项目的思考,拓宽读者对区块链与数字经济认知的边界。",
image: `${rootUrl}/logo.png`,
link: rootUrl,
item: items
};
}
//#endregion
export { route };