UNPKG

rsshub

Version:
41 lines (40 loc) 1.15 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as cache_default } from "./cache-CiDoUSLo.mjs"; import { load } from "cheerio"; //#region lib/routes/axis-studios/work.ts const baseUrl = "https://axis-studios.com"; const route = { path: "/work", categories: ["design"], example: "/axis-studios/work", radar: [{ source: ["axis-studios.com/work"] }], name: "Work", maintainers: ["MisteryMonster"], handler }; async function handler() { const $ = load(await rofetch(`${baseUrl}/work/`)); const list = $("main ul li a[href^=\"/project/\"]").toArray().map((item) => { const $item = $(item); return { title: $item.attr("title"), link: new URL($item.attr("href"), baseUrl).href }; }); const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { const article = load(await rofetch(item.link))("article"); article.find("nav, h1").remove(); return { ...item, description: article.html() }; }))); return { title: "Axis Studios | Work", link: `${baseUrl}/work/`, description: $("main p").first().text().trim(), item: items }; } //#endregion export { route };