UNPKG

rsshub

Version:
47 lines (45 loc) 1.36 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import { t as md5 } from "./md5-Dce_BvZj.mjs"; import { load } from "cheerio"; //#region lib/routes/apple/design.ts const route = { categories: ["design"], example: "/apple/design", handler, maintainers: ["jean-jacket"], name: "Design updates", path: "/design", url: "developer.apple.com/design/whats-new/" }; async function handler() { const LINK = "https://developer.apple.com/design/whats-new/"; const $ = load(await ofetch_default(LINK)); return { item: $("table").toArray().flatMap((item) => { const table = $(item); const date = table.find(".date").first().text(); return table.find(".topic-item").toArray().map((row) => { const update = $(row); const titleTag = update.find("span.topic-title a"); const title = titleTag.text(); const link = `https://developer.apple.com${titleTag.attr("href")}`; const description = update.find("span.description").text(); return { description, guid: md5(`${title}${description}${date}`), link, pubDate: parseDate(date), title }; }); }), link: LINK, title: "Apple design updates" }; } //#endregion export { route };