UNPKG

rsshub

Version:
32 lines (31 loc) 1.01 kB
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs"; import { t as parseDate } from "./parse-date-CjhZE69i.mjs"; import { t as timezone } from "./timezone-DE--ze1V.mjs"; import { load } from "cheerio"; //#region lib/routes/keyakizaka46/news.ts const route = { path: "/news", categories: ["new-media"], example: "/keyakizaka46/news", name: "Keyakizaka46 News 欅坂 46 新闻", maintainers: ["crispgm"], handler }; async function handler() { const $ = load(await rofetch("https://www.keyakizaka46.com/s/k46o/news/list", { headers: { Referer: "http://www.keyakizaka46.com/" } })); return { allowEmpty: true, title: "欅坂46官网 NEWS", link: "http://www.keyakizaka46.com/news/", item: $("div.keyaki-news div.box-news ul li").toArray().map((item) => { const $item = $(item); return { title: $item.find("div.text a").text(), link: $item.find("div.text a").attr("href"), pubDate: timezone(parseDate($item.find("div.date").text()), 9) }; }) }; } //#endregion export { route };