UNPKG

rsshub

Version:
35 lines (34 loc) 1.06 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; //#region lib/routes/utdallas/isso.ts const route = { path: "/isso", categories: ["university"], example: "/utdallas/isso", radar: [{ source: ["isso.utdallas.edu"] }], name: "International Student Services", maintainers: ["Chang4Tech"], handler, url: "isso.utdallas.edu" }; async function handler(ctx) { const limit = ctx.req.query("limit") ? Number(ctx.req.query("limit")) : 10; const link = "https://isso.utdallas.edu"; return { title: "UTDallas - International Student Services", link, item: (await rofetch(`${link}/wp-json/wp/v2/posts`, { query: { _embed: "", per_page: limit === 10 ? void 0 : limit } })).map((post) => ({ title: post.title.rendered, link: post.link, description: post.content.rendered, pubDate: parseDate(post.date_gmt), author: post._embedded?.author?.[0]?.name, category: post._embedded?.["wp:term"]?.flat().map((term) => term.name) })) }; } //#endregion export { route };