UNPKG

rsshub

Version:
31 lines (30 loc) 906 B
import { t as buildData } from "./common-config-C_kYfD8G.mjs"; //#region lib/routes/polimi/news.ts const route = { path: "/news/:language?", categories: ["university"], example: "/polimi/news", parameters: { language: "English language code en" }, name: "News", maintainers: ["exuanbo"], handler }; async function handler(ctx) { const { language } = ctx.req.param(); const link = language === "en" ? "https://www.polimi.it/en/the-politecnico/news" : "https://www.polimi.it/il-politecnico/news"; return await buildData({ link, url: link, title: "Polimi News", params: { homeLink: "https://www.polimi.it" }, item: { item: ".card--editorial-photo", title: `$('.card-title').text()`, link: `'%homeLink%' + $('.card-footer a').attr('href')`, description: `$('.news-bodytext').html()`, pubDate: `parseDate($('time').attr('datetime'))` } }); } //#endregion export { route };