style: auto format

This commit is contained in:
GitHub Action 2022-01-22 20:06:55 +00:00
parent d95705b4db
commit 2253744204
1 changed files with 19 additions and 15 deletions

View File

@ -27,23 +27,27 @@ module.exports = async (ctx) => {
const items = await Promise.all(
list &&
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const article = await got({
url: item.link,
header: {
Referer: baseUrl + '/breaches',
},
});
const content = cheerio.load(article.body);
ctx.cache.tryGet(
item.link,
async () => {
const article = await got({
url: item.link,
header: {
Referer: baseUrl + '/breaches',
},
});
const content = cheerio.load(article.body);
item.description = art(path.join(__dirname, 'templates/description.art'), {
header: content('#breach-detail').html(),
overview: content('section.detail-section.jst-cntr.flx.flx-col').html(),
dataClasses: content('section.detail-section.bg-white.jst-cntr.flx.flx-col').html(),
});
item.description = art(path.join(__dirname, 'templates/description.art'), {
header: content('#breach-detail').html(),
overview: content('section.detail-section.jst-cntr.flx.flx-col').html(),
dataClasses: content('section.detail-section.bg-white.jst-cntr.flx.flx-col').html(),
});
return item;
}, 31536000)
return item;
},
31536000
)
)
);