UNPKG

rsshub

Version:
31 lines (30 loc) 869 B
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs"; import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { load } from "cheerio"; //#region lib/routes/ollama/blog.ts const route = { path: "/blog", categories: ["programming"], example: "/ollama/blog", radar: [{ source: ["ollama.com/blog"] }], name: "Blog", maintainers: ["gavrilov"], handler }; async function handler() { const baseUrl = "https://ollama.com"; const response = await rofetch(`${baseUrl}/blog`); const $ = load(response); return { title: "ollama blog", link: "https://ollama.com/blog", item: $("a.group.border-b.py-10").toArray().map((item) => ({ title: $(item).children("h2").text(), link: baseUrl + $(item).attr("href"), pubDate: parseDate($(item).children("h3").text()), description: $(item).children("p").text() })) }; } //#endregion export { route };