rsshub
Version:
Make RSS Great Again!
55 lines (53 loc) • 1.49 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 parseDate } from "./parse-date-BrP7mxXf.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import { load } from "cheerio";
//#region lib/routes/huggingface/blog-zh.ts
const route = {
path: "/blog-zh",
categories: ["programming"],
example: "/huggingface/blog-zh",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["huggingface.co/blog/zh", "huggingface.co/"] }],
name: "中文博客",
maintainers: ["zcf0508"],
handler,
url: "huggingface.co/blog/zh"
};
async function handler() {
const { body: response } = await got_default("https://huggingface.co/blog/zh");
const $ = load(response);
return {
title: "Huggingface 中文博客",
link: "https://huggingface.co/blog/zh",
item: $("div[data-target=\"BlogThumbnail\"]").toArray().map((item) => {
const props = $(item).data("props");
const link = $(item).find("a").attr("href");
return {
...props,
link
};
}).map((item) => ({
title: item.blog.title,
link: `https://huggingface.co${item.link}`,
category: item.blog.tags,
pubDate: parseDate(item.blog.publishedAt),
author: item.blog.author
}))
};
}
//#endregion
export { route };