UNPKG

rsshub

Version:
52 lines (50 loc) 1.61 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import { t as ofetch_default } from "./ofetch-DKl_Ma9g.mjs"; import { t as parseDate } from "./parse-date-r5WDWHno.mjs"; import "./is-worker-DESPicPc.mjs"; import { t as cache_default } from "./cache-SV6W5EPy.mjs"; import { t as timezone } from "./timezone-CA9Huotp.mjs"; import { load } from "cheerio"; //#region lib/routes/miyuki/news.ts const ORIGIN = "https://miyuki.jp"; const NEWS_LINK = `${ORIGIN}/s/y10/news/list`; const route = { path: "/news", example: "/miyuki/news", name: "News", categories: ["new-media"], maintainers: ["KarasuShin"], features: { supportRadar: true }, handler, radar: [{ source: ["miyuki.jp", "miyuki.jp/s/y10/news/list"], target: "/news" }] }; async function handler() { const $ = load(await ofetch_default(NEWS_LINK)); return { title: "中島みゆき Official - News", link: NEWS_LINK, item: await Promise.all($(".list__side_border li").toArray().map(async (item) => { const $item = $(item); const link = `${ORIGIN}${$item.find("a").attr("href")}`; return await cache_default.tryGet(link, async () => { const category = $item.find("p span").last().text(); return { title: `${category} - ${$item.find("a").text()}`, link, pubDate: timezone(parseDate($item.find("p span").first().text()), 9), category: [category], description: await cache_default.tryGet(link, async () => { return load(await ofetch_default(link))(".contents_area__inner").html(); }) }; }); })) }; } //#endregion export { route };