UNPKG

rsshub

Version:
33 lines (32 loc) 1.04 kB
import { t as rofetch } from "./ofetch-U0CdpE2g.mjs"; import { t as parseDate } from "./parse-date-3kcy2Eau.mjs"; import { t as timezone } from "./timezone-UiMFOuvL.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 response = await rofetch("https://www.keyakizaka46.com/s/k46o/news/list", { headers: { Referer: "http://www.keyakizaka46.com/" } }); const $ = load(response); 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 };