Files
RSSHub/lib/v2/gov/pbc/utils.js
T
2024-02-28 16:51:42 +08:00

22 lines
520 B
JavaScript

import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
const processItems = (list) =>
Promise.all(
list.map((item) =>
cache.tryGet(item.link, async () => {
const detailResponse = await got.post(item.link);
const content = load(detailResponse.data);
item.description = content('div.xxy_text').html();
return item;
})
)
);
module.exports = {
processItems,
};