UNPKG

rsshub

Version:
34 lines (32 loc) 934 B
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./parse-date-r5WDWHno.mjs"; import "./helpers-Bo4JQYdN.mjs"; import { t as got_default } from "./got-CO-ndVl2.mjs"; import "./timezone-CA9Huotp.mjs"; import { a as notesUrl, n as extractNotes } from "./utils-B_tc2__q.mjs"; import { load } from "cheerio"; //#region lib/routes/qoo-app/notes/topic.ts const route = { path: "/notes/:lang?/topic/:topic", name: "Unknown", maintainers: ["TonyRL"], handler }; async function handler(ctx) { const { topic, lang } = ctx.req.param(); const link = `${notesUrl}${lang ? `/${lang}` : ""}/topic/${topic}`; const { data: response } = await got_default(link); const $ = load(response); const items = extractNotes($); return { title: $("head title").text(), link, language: $("html").attr("lang"), item: items }; } //#endregion export { route };