rsshub
Version:
Make RSS Great Again!
47 lines (45 loc) • 1.35 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs";
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs";
import { load } from "cheerio";
//#region lib/routes/immich/cursed-knowledge.ts
const route = {
path: "/cursed-knowledge",
categories: ["blog"],
example: "/immich/cursed-knowledge",
radar: [{
source: ["immich.app/cursed-knowledge", "immich.app"],
target: "/cursed-knowledge"
}],
name: "Cursed Knowledge",
maintainers: ["TonyRL"],
handler
};
async function handler() {
const baseUrl = "https://immich.app";
const link = `${baseUrl}/cursed-knowledge/`;
const $ = load(await ofetch_default(link));
const items = $("div.justify-around ul li").toArray().map((item) => {
const $item = $(item);
const href = $item.find("a").attr("href");
const title = $item.find("section p").first().text();
return {
title,
description: $item.find("section p").last().text(),
link: href ?? `${link}#${title}`,
pubDate: parseDate($item.find("div.justify-start").text())
};
});
return {
title: $("head title").text(),
description: $("p.text-center").text(),
image: `${baseUrl}${$("head link[rel=\"icon\"]").attr("href")}`,
link,
item: items
};
}
//#endregion
export { route };