Files
RSSHub/lib/v2/gov/pbc/utils.js
Fatpandac 0ec2b01ec2 feat(route): add 政策研究, 工作论文 and refactor to V2 (#9324)
* feat(route): add 政策研究, 工作论文 and refactor to V2

* fix: depreciated url.resolve pubDate
2022-03-16 04:13:45 +08:00

21 lines
523 B
JavaScript

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