rsshub
Version:
Make RSS Great Again!
35 lines (34 loc) • 960 B
JavaScript
import { t as rofetch } from "./ofetch-eUBdfMpp.mjs";
import { load } from "cheerio";
//#region lib/routes/sec.today/pulses.ts
const host = "https://sec.today";
const route = {
path: "/pulses",
categories: ["blog"],
example: "/sec.today/pulses",
name: "推送",
maintainers: ["LogicJake"],
features: { antiCrawler: true },
handler
};
async function handler() {
const link = `${host}/pulses/`;
const $ = load(await rofetch(link));
return {
title: "每日安全推送",
link,
item: $("div.endless_page_template div.card").slice(0, 10).toArray().map((item) => {
const $item = $(item);
const author = $item.find("div.card-body small.card-subtitle").text().trim();
const itemUrl = $item.find("h5.card-title > a").attr("href");
return {
link: new URL(itemUrl, host).href,
description: $item.find("p.card-text.my-1").html(),
title: $item.find("h5.card-title").text(),
author
};
})
};
}
//#endregion
export { route };