mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-03-13 10:30:18 +08:00
fix: parse VXNA entry date (#21325)
This commit is contained in:
@@ -3,6 +3,7 @@ import { load } from 'cheerio';
|
||||
import type { Route } from '@/types';
|
||||
import { ViewType } from '@/types';
|
||||
import got from '@/utils/got';
|
||||
import { parseRelativeDate } from '@/utils/parse-date';
|
||||
|
||||
export const route: Route = {
|
||||
path: '/xna',
|
||||
@@ -39,12 +40,14 @@ async function handler(ctx) {
|
||||
.map((dom) => {
|
||||
const link = $(dom).find('.xna-entry-title > a');
|
||||
const author = $(dom).find('.xna-source-author > a').text();
|
||||
const dateText = $(dom).find('.xna-entry-date').text().trim();
|
||||
|
||||
return {
|
||||
title: $(link).text(),
|
||||
link: $(link).attr('href'),
|
||||
description: $(link).text(),
|
||||
author,
|
||||
pubDate: dateText ? parseRelativeDate(dateText) : undefined,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user