mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 16:20:27 +08:00
chore(deps-dev): bump prettier from 1.19.1 to 2.0.2
This commit is contained in:
@@ -11,31 +11,21 @@ module.exports = async (ctx) => {
|
||||
const $ = cheerio.load(response.data);
|
||||
const meta = $('.mp-info__list .mp-info__value');
|
||||
|
||||
const author = $(meta[0])
|
||||
.text()
|
||||
.trim();
|
||||
const author = $(meta[0]).text().trim();
|
||||
|
||||
const year = new Date().getFullYear();
|
||||
const items = await Promise.all(
|
||||
$('.post-item__main')
|
||||
.get()
|
||||
.map(async (e) => {
|
||||
let pubDate = date(
|
||||
`${year} ${$(e)
|
||||
.find('.post-item__date')
|
||||
.text()
|
||||
.trim()}`,
|
||||
8
|
||||
);
|
||||
let pubDate = date(`${year} ${$(e).find('.post-item__date').text().trim()}`, 8);
|
||||
|
||||
if (new Date(pubDate) > new Date()) {
|
||||
pubDate = new Date(pubDate).setFullYear(year - 1);
|
||||
pubDate = new Date(pubDate).toUTCString();
|
||||
}
|
||||
|
||||
const link = `https://wemp.app${$(e)
|
||||
.find('.post-item__title')
|
||||
.attr('href')}`;
|
||||
const link = `https://wemp.app${$(e).find('.post-item__title').attr('href')}`;
|
||||
|
||||
const response = await ctx.cache.tryGet(link, async () => (await got.get(link)).data);
|
||||
const article = cheerio.load(response);
|
||||
@@ -47,10 +37,7 @@ module.exports = async (ctx) => {
|
||||
}
|
||||
|
||||
const single = {
|
||||
title: $(e)
|
||||
.find('.post-item__title')
|
||||
.text()
|
||||
.trim(),
|
||||
title: $(e).find('.post-item__title').text().trim(),
|
||||
link: weixinLink || link,
|
||||
description: article('#content').html(),
|
||||
pubDate,
|
||||
@@ -64,9 +51,7 @@ module.exports = async (ctx) => {
|
||||
ctx.state.data = {
|
||||
title: `微信公众号 - ${author}`,
|
||||
link: `https://wemp.app/accounts/${id}/`,
|
||||
description: $(meta[1])
|
||||
.text()
|
||||
.trim(),
|
||||
description: $(meta[1]).text().trim(),
|
||||
item: items,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user