rsshub
Version:
Make RSS Great Again!
43 lines (42 loc) • 1.24 kB
JavaScript
import { t as rofetch } from "./ofetch-C3ts-Hud.mjs";
import { t as parseDate } from "./parse-date-Cr0wQjV_.mjs";
import { t as md5 } from "./md5-CpIHIxCO.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 rofetch(LINK));
return {
item: $("table").toArray().flatMap((item) => {
const table = $(item);
const date = table.find(".date").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 };