rsshub
Version:
Make RSS Great Again!
64 lines (62 loc) • 1.53 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./timezone-D8cuwzTY.mjs";
import { t as common_config_default } from "./common-config-ChcwGVXn.mjs";
//#region lib/routes/aiea/index.ts
const route = {
path: "/seminars/:period",
categories: ["study"],
example: "/aiea/seminars/upcoming",
parameters: { period: "Time frame" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "Seminar Series",
maintainers: ["zxx-457"],
handler,
description: `| Time frame |
| ---------- |
| upcoming |
| past |
| both |`
};
async function handler(ctx) {
const link = "http://www.aiea.org/0504";
const period = ctx.req.param("period") ?? "";
let nth_child = "n";
switch (period) {
case "upcoming":
nth_child = "1";
break;
case "past":
nth_child = "2";
break;
case "both":
nth_child = "n";
break;
default: break;
}
return await common_config_default({
link,
url: link,
title: `%title%`,
params: { title: "AIEA Seminars" },
item: {
item: `.seminar-contents .seminar-partWrap:nth-child(${nth_child}) > .seminar-list`,
title: `$('.seminar-list-title > span').text()`,
link: `$('a[href^="/0504"]').attr('href')`,
description: `$('.seminar-list .txt > .title').text()`
}
});
}
//#endregion
export { route };