mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
fix: handle wemp future pubDate (#1546)
This commit is contained in:
@@ -16,23 +16,32 @@ module.exports = async (ctx) => {
|
||||
const items = $('.post-item__main')
|
||||
.slice(0, 10)
|
||||
.get()
|
||||
.map((e) => ({
|
||||
title: $(e)
|
||||
.find('.post-item__title')
|
||||
.text()
|
||||
.trim(),
|
||||
link: `https://wemp.app${$(e)
|
||||
.find('.post-item__title')
|
||||
.attr('href')}`,
|
||||
pubDate: date(
|
||||
.map((e) => {
|
||||
let pubDate = date(
|
||||
`${year} ${$(e)
|
||||
.find('.post-item__date')
|
||||
.text()
|
||||
.trim()}`,
|
||||
8
|
||||
),
|
||||
author,
|
||||
}));
|
||||
);
|
||||
|
||||
if (new Date(pubDate) > new Date()) {
|
||||
pubDate = new Date(pubDate).setFullYear(year - 1);
|
||||
pubDate = new Date(pubDate).toUTCString();
|
||||
}
|
||||
|
||||
return {
|
||||
title: $(e)
|
||||
.find('.post-item__title')
|
||||
.text()
|
||||
.trim(),
|
||||
link: `https://wemp.app${$(e)
|
||||
.find('.post-item__title')
|
||||
.attr('href')}`,
|
||||
pubDate,
|
||||
author,
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `微信公众号 - ${author}`,
|
||||
|
||||
Reference in New Issue
Block a user