UNPKG

rsshub

Version:
65 lines (63 loc) 1.8 kB
import "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import { t as ViewType } from "./types-D84BRIt4.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import { load } from "cheerio"; //#region lib/routes/manus/blog.ts const route = { path: "/blog", categories: ["programming"], example: "/manus/blog", url: "manus.im", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["www.manus.im"], target: "/blog" }], name: "Blog", maintainers: ["cscnk52"], handler, description: "Manus Blog", view: ViewType.Notifications }; async function handler() { const rootUrl = "https://manus.im/blog"; const $ = load(await ofetch_default(rootUrl)); const list = $("div.mt-10.px-6 > a").toArray().map((item) => { const element = $(item); return { link: new URL(String(element.attr("href")), rootUrl).href, title: String(element.find("h2").attr("title")) }; }); return { title: "Manus", link: rootUrl, item: await Promise.all(list.map((item) => cache_default.tryGet(String(item.link), async () => { const $$1 = load(await ofetch_default(String(item.link))); const description = $$1("div.relative:nth-child(3)").html() ?? ""; const pubDateText = $$1("div.gap-3:nth-child(1) > span:nth-child(2)").text().trim(); const currentYear = (/* @__PURE__ */ new Date()).getFullYear(); const pubDate = /* @__PURE__ */ new Date(`${pubDateText} ${currentYear}`); return { ...item, description, pubDate }; }))), language: "en" }; } //#endregion export { route };