rsshub
Version:
Make RSS Great Again!
53 lines (51 loc) • 1.61 kB
JavaScript
import "./dist-Bog6z_OM.mjs";
import "./config-MQ-7ebJ_.mjs";
import "./logger-C4avouvV.mjs";
import "./ofetch-DKl_Ma9g.mjs";
import { n as parseRelativeDate } from "./parse-date-r5WDWHno.mjs";
import "./is-worker-DESPicPc.mjs";
import { t as cache_default } from "./cache-SV6W5EPy.mjs";
import "./helpers-Bo4JQYdN.mjs";
import { t as got_default } from "./got-CO-ndVl2.mjs";
import { load } from "cheerio";
//#region lib/routes/guangdiu/rank.ts
const host = "https://guangdiu.com";
const route = {
path: "/rank",
categories: ["shopping"],
example: "/guangdiu/rank",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["guangdiu.com/rank"] }],
name: "一小时风云榜",
maintainers: ["fatpandac"],
handler,
url: "guangdiu.com/rank"
};
async function handler() {
const url = `${host}/rank.php`;
const $ = load((await got_default(url)).data);
const list = $("div.hourrankitem").toArray().map((item) => ({
title: $(item).find("a.hourranktitle").text(),
link: new URL($(item).find("a.hourranktitle").attr("href"), host).href
}));
return {
title: `逛丢 - 一小时风云榜`,
link: url,
item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => {
const $ = load((await got_default(item.link)).data);
item.description = $("#dabstract").html() + $("a.dgotobutton").html("前往购买");
item.pubDate = parseRelativeDate($("div.hourranktime").text());
return item;
})))
};
}
//#endregion
export { route };