UNPKG

rsshub

Version:
28 lines (26 loc) 926 B
import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import * as url from "node:url"; import { load } from "cheerio"; //#region lib/routes/leiphone/utils.ts const ProcessFeed = async (list, cache) => { const host = "https://www.leiphone.com"; return await Promise.all(list.map(async (e) => { const link = url.resolve(host, e); return await cache.tryGet(link, async () => { const $ = load((await got_default.get(link)).data); let description = ""; if ($(".top-img").html() !== null) description += $(".top-img").html(); return { title: $(".headTit").text(), description: description + $(".article-lead").text() + $(".lph-article-comView").html(), pubDate: parseDate($(".time").text(), 8), author: $(".aut > a").text(), link }; }); })); }; var utils_default = { ProcessFeed }; //#endregion export { utils_default as t };