style: auto format
This commit is contained in:
parent
d95705b4db
commit
2253744204
|
|
@ -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
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue