UNPKG

rsshub

Version:
40 lines (39 loc) 1.06 kB
import { t as got_default } from "./got-BTowW50G.mjs"; import { a as notesUrl, n as extractNotes } from "./utils-DTZARMsA2.mjs"; import { load } from "cheerio"; //#region lib/routes/qoo-app/notes/topic.ts const route = { path: "/notes/:lang?/topic/:topic", categories: ["anime"], example: "/qoo-app/notes/en/topic/QooAppGacha", parameters: { lang: "Language, see the table above, empty means `中文`", topic: "Hashtag name without `#`" }, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, name: "Hot Hashtags", 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 };