rsshub
Version:
Make RSS Great Again!
40 lines (39 loc) • 1.15 kB
JavaScript
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs";
import { t as parseDate } from "./parse-date-3kcy2Eau.mjs";
import { t as namespace } from "./namespace-CwV8KdhH.mjs";
//#region lib/routes/yinxubwg/notice.ts
const route = {
path: "/notice",
categories: ["travel"],
example: "/yinxubwg/notice",
name: "Notice",
maintainers: ["magazian"],
radar: [{
source: ["www.yinxubwg.cn/yxgw/notice"],
target: "/notice"
}],
handler: async () => {
const cate = 1;
const baseUrl = "https://www.yinxubwg.cn";
const apiBaseUrl = "https://guc.yinxubwg.cn";
const museumName = namespace.zh?.name || namespace.name;
const items = ((await rofetch(`${apiBaseUrl}/gwebapi/article/list`, { query: {
p: "w",
cate_id: cate,
page: 1,
limit: 9
} })).data?.list ?? []).map((item) => ({
title: item.title,
link: item.out_url || `${baseUrl}/yxgw/notice/detail?id=${item.article_id}&cate=${cate}&pos=news`,
pubDate: parseDate(item.push_time_new)
}));
return {
title: `${museumName} - 最新公告`,
link: `${baseUrl}/yxgw/notice?cate=${cate}`,
language: "zh-CN",
item: items
};
}
};
//#endregion
export { route };