rsshub
Version:
Make RSS Great Again!
55 lines (54 loc) • 1.53 kB
JavaScript
import { t as parseDate } from "./parse-date-3kcy2Eau.mjs";
import { t as cache_default } from "./cache-C1Y-9qDV.mjs";
import { t as got_default } from "./got-DUpa1V3-.mjs";
import { t as timezone } from "./timezone-UiMFOuvL.mjs";
import { load } from "cheerio";
//#region lib/routes/mpaypass/news.ts
const route = {
path: "/news",
categories: ["new-media"],
example: "/mpaypass/news",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["mpaypass.com.cn/"] }],
name: "新闻",
maintainers: ["LogicJake", "genghis-yang"],
handler,
url: "mpaypass.com.cn/"
};
async function handler() {
const link = "http://m.mpaypass.com.cn";
const listData = await got_default(link);
const $list = load(listData.data);
return {
title: "新闻 - 移动支付网",
link,
language: "zh-CN",
item: await Promise.all($list(".Newslist-li").toArray().map((el) => {
const $el = $list(el);
const $a = $el.find(".Newslist-title a");
const href = $a.attr("href");
const title = $a.text();
const date = $el.find(".Newslist-time span").text();
return cache_default.tryGet(href, async () => {
const contentData = await got_default.get(href);
const description = load(contentData.data)(".newslist-body").html();
return {
title,
description,
link: href,
pubDate: timezone(parseDate(date), 8)
};
});
}))
};
}
//#endregion
export { route };