UNPKG

rsshub

Version:
34 lines (33 loc) 1.03 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { load } from "cheerio"; //#region lib/routes/jingwei.link/index.ts const route = { path: "/", categories: ["blog"], example: "/jingwei.link", name: "文章", maintainers: ["a180285"], handler }; async function handler() { const url = "https://jingwei.link/"; const $ = load(await rofetch(url)); return { title: "敬维-以认真的态度做完美的事情", link: url, item: $("article[class='article-item']").toArray().map((elem) => { const $esction = $(elem).find("section[class=\"post-preview\"]"); return { title: $esction.find("h2").text(), description: $esction.find("h3").text(), link: new URL($esction.find("a").attr("href"), url).href, author: "敬维", category: $(elem).find("a.post-tag").toArray().map((tag) => $(tag).text()), pubDate: parseDate($(elem).find("time.post-date").attr("datetime"), "YY-MM-DD") }; }) }; } //#endregion export { route };