UNPKG

rsshub

Version:
37 lines (36 loc) 920 B
import { t as got_default } from "./got-BTowW50G.mjs"; import { load } from "cheerio"; //#region lib/routes/blogread/index.ts const route = { path: "/newest", categories: ["programming"], example: "/blogread/newest", radar: [{ source: ["blogread.cn/news/newest.php"] }], name: "最新文章", maintainers: ["fashioncj"], handler }; async function handler() { const url = "https://blogread.cn/news/newest.php"; const $ = load((await got_default({ method: "get", url })).data); return { title: "技术头条", link: url, item: $(".media").toArray().map((elem) => { const $elem = $(elem); const $link = $elem.find("dt a"); return { title: $link.text(), description: $elem.find("dd").eq(0).text(), link: $link.attr("href"), author: $elem.find(".small a").eq(0).text(), pubDate: $elem.find("dd").eq(1).text().split("\n", 3)[2] }; }) }; } //#endregion export { route };