UNPKG

rsshub

Version:
39 lines (38 loc) 1.09 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/huodongxing/explore.ts const route = { path: "/explore", categories: ["travel"], example: "/huodongxing/explore", name: "最新活动", maintainers: ["nakadaole"], handler }; async function handler() { const host = "https://www.huodongxing.com"; const $ = load(await rofetch(`${host}/eventlist`)); const list = $("div.search-tab-content-item").toArray().map((item) => { const $item = $(item); const $a = $item.find(".item-title"); const link = new URL($a.attr("href"), host); link.search = ""; return { title: $a.text(), link: link.href, author: $item.find(".user-name").text() }; }); const items = await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { item.description = load(await rofetch(item.link))("#event_desc_page").html(); return item; }))); return { title: "活动行", link: `${host}/eventlist`, item: items }; } //#endregion export { route };