Files
RSSHub/lib/v2/gov/pbc/utils.js
T
Tony 589ddb3a43 refactor(eslint): add back no-return-await (#11877)
* chore: add back no-return-await

* chore: fix action warning

* chore: fix all no-return-await
2023-02-16 04:30:05 +08:00

21 lines
511 B
JavaScript

const got = require('@/utils/got');
const cheerio = require('cheerio');
const processItems = (list, ctx) =>
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,
};