rsshub
Version:
Make RSS Great Again!
62 lines (60 loc) • 1.7 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import { t as cache_default } from "./cache-Bo__VnGm.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/europechinese/latest.ts
const route = {
path: "/latest",
categories: ["new-media"],
example: "/europechinese/latest",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["europechinese.blogspot.com"] }],
name: "最新",
maintainers: ["emdoe"],
handler,
url: "europechinese.blogspot.com/"
};
async function handler() {
const url = `https://europechinese.blogspot.com/`;
const { data: response } = await got_default(url);
const $ = load(response);
const list = $("h3.post-title");
return {
title: `歐洲動態(國際)| 最新`,
link: url,
item: await Promise.all(list.map((_, item) => {
const title = $(item).find("a").text();
const link = $(item).find("a").attr("href");
return cache_default.tryGet(link, async () => {
const { data: response$1 } = await got_default(link);
const $$1 = load(response$1);
$$1("div.widget-content").remove();
$$1("div.byline").remove();
$$1("div.post-sidebar").remove();
const time = $$1("time.published").attr("datetime");
return {
title,
link,
guid: link,
description: $$1("div.post-body-container").html(),
pubDate: time
};
});
}))
};
}
//#endregion
export { route };