UNPKG

rsshub

Version:
38 lines (37 loc) 1.02 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { load } from "cheerio"; //#region lib/routes/yidoutang/mtest.ts const route = { path: "/mtest", categories: ["new-media"], example: "/yidoutang/mtest", name: "众测", maintainers: ["sanmmm"], handler }; async function handler() { const url = "http://www.yidoutang.com/mtest"; const $ = load(await rofetch(url)); return { title: "一兜糖 - 众测", description: "一兜糖 - 众测", link: url, item: $(".zc-bd .zc-bd-left > .clearfix > a").toArray().map((ele) => { const $item = $(ele); const thumbnail = $item.find(".top > img").attr("src"); const deadline = $item.find(".top > .time").text(); const otherInfoArr = $item.find(".bottom").text().trim().split("\n"); return { title: otherInfoArr[0], link: $item.attr("href"), description: [ deadline, ...otherInfoArr, `<img src="${thumbnail}"/>` ].filter((str) => !!str.trim()).join("<br/>") }; }) }; } //#endregion export { route };