UNPKG

rsshub

Version:
42 lines (41 loc) 1.05 kB
import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as got_default } from "./got-DUpa1V3-.mjs"; import { load } from "cheerio"; //#region lib/routes/zhujiceping/rss.ts const route = { path: "/", categories: ["blog"], example: "/zhujiceping", radar: [{ source: ["zhujiceping.com/"] }], name: "最新发布", maintainers: ["cnkmmk"], handler, url: "zhujiceping.com/" }; async function handler() { const url = "https://www.zhujiceping.com/"; const response = await got_default({ method: "get", url }); const $ = load(response.data); return { title: "国外主机测评", link: url, item: $("article.excerpt").toArray().map((e) => { const element = $(e); const title = element.find("h2 > a").attr("title"); const link = element.find("h2 > a").attr("href"); const description = element.find("p.note").text(); const dateraw = element.find("time").text(); return { title, description, link, pubDate: parseDate(dateraw, "YYYY-MM-DD") }; }) }; } //#endregion export { route };