rsshub
Version:
Make RSS Great Again!
32 lines (31 loc) • 941 B
JavaScript
import { t as rofetch } from "./ofetch-W1aeTHCo.mjs";
import { load } from "cheerio";
//#region lib/routes/grand-challenge/challenges.ts
const route = {
path: "/challenges",
categories: ["other"],
example: "/grand-challenge/challenges",
name: "Challenge 列表",
maintainers: ["WhoIsSure"],
handler
};
async function handler() {
const link = "https://grand-challenge.org/challenges/";
const $ = load(await rofetch(link));
return {
title: "Grand-Challenge-challenges",
link,
item: $(".equal-height .card").toArray().map((item) => {
const $item = $(item);
const itemPicUrl = $item.find("img").attr("src");
const description = $item.find("a[data-description]").attr("data-description") || "No description";
return {
title: $item.find("h5").text(),
description: `${description}<br><img src="${itemPicUrl}">`,
link: $item.find(".stretched-link").attr("href")
};
})
};
}
//#endregion
export { route };