rsshub
Version:
Make RSS Great Again!
35 lines (34 loc) • 1.08 kB
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { t as parseDate } from "./parse-date-CjhZE69i.mjs";
import { load } from "cheerio";
//#region lib/routes/umass/csnews.ts
const route = {
path: "/amherst/csnews",
categories: ["university"],
example: "/umass/amherst/csnews",
radar: [{ source: ["www.cics.umass.edu/news"] }],
name: "College of Information & Computer Sciences News",
maintainers: ["GammaPi"],
handler
};
async function handler() {
const link = "https://www.cics.umass.edu/news";
const $ = load(await rofetch(link));
return {
title: "UMAmherst-CSNews",
link,
item: $(".listing__row .news-teaser").toArray().map((item) => {
const $item = $(item);
const a = $item.find(".news-teaser__title a");
return {
title: a.text().trim(),
description: $item.find(".news-teaser__summary").text().trim(),
link: new URL(a.attr("href"), link).href,
pubDate: parseDate($item.find(".news-teaser__date").text(), "MMMM D, YYYY"),
category: $item.find(".news-teaser__category a").text()
};
})
};
}
//#endregion
export { route };