style: auto format

This commit is contained in:
github-actions[bot]
2022-12-05 15:54:52 +00:00
parent a257b9adc7
commit e9a6ff3ac3
+20 -18
View File
@@ -10,24 +10,26 @@ module.exports = async (ctx) => {
const $ = cheerio.load(html);
const title = 'Bangumi - ' + $('.SecondaryNavTitle').text();
const items = await Promise.all($('.topic_list .topic')
.toArray()
.map(async (elem) => {
const link = new URL($('.subject a', elem).attr('href'), base_url).href;
const fullText = await ctx.cache.tryGet(link, async () => {
const { data: html } = await got(link);
const $ = cheerio.load(html);
return $('.postTopic .topic_content').html();
});
const summary = 'Reply: ' + $('.posts', elem).text();
return {
link,
title: $('.subject a', elem).attr('title'),
pubDate: parseDate($('.lastpost .time', elem).text()),
description: fullText ? summary + '<br><br>' + fullText : summary,
author: $('.author a', elem).text(),
};
}));
const items = await Promise.all(
$('.topic_list .topic')
.toArray()
.map(async (elem) => {
const link = new URL($('.subject a', elem).attr('href'), base_url).href;
const fullText = await ctx.cache.tryGet(link, async () => {
const { data: html } = await got(link);
const $ = cheerio.load(html);
return $('.postTopic .topic_content').html();
});
const summary = 'Reply: ' + $('.posts', elem).text();
return {
link,
title: $('.subject a', elem).attr('title'),
pubDate: parseDate($('.lastpost .time', elem).text()),
description: fullText ? summary + '<br><br>' + fullText : summary,
author: $('.author a', elem).text(),
};
})
);
ctx.state.data = {
title,