rsshub
Version:
Make RSS Great Again!
56 lines (54 loc) • 1.5 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { t as parseDate } from "./parse-date-r5WDWHno.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import { t as renderDescription } from "./description-IcB8gsyT.mjs";
import { load } from "cheerio";
//#region lib/routes/techcrunch/news.ts
const host = "https://techcrunch.com";
const route = {
path: "/news",
categories: ["new-media"],
example: "/techcrunch/news",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["techcrunch.com/"] }],
name: "News",
maintainers: ["EthanWng97"],
handler,
url: "techcrunch.com/"
};
async function handler() {
const { data } = await got_default(`${host}/wp-json/wp/v2/posts`);
return {
title: "TechCrunch",
link: host,
description: "Reporting on the business of technology, startups, venture capital funding, and Silicon Valley.",
item: data.map((item) => {
const head = item.yoast_head_json;
const $ = load(item.content.rendered, null, false);
$(".wp-block-techcrunch-inline-cta").remove();
return {
title: item.title.rendered,
description: renderDescription({
head,
rendered: $.html()
}),
link: item.link,
pubDate: parseDate(item.date_gmt)
};
})
};
}
//#endregion
export { route };