Files
RSSHub/lib/routes/fishshell/index.ts
T
Tony 267eb1e615 docs: add back route metadata for unknown routes (#22865)
* fix: add back route metadata

* fix: update route handlers to use ctx.req.param for path retrieval

* fix: add back route metadata for tsx

* fix: remove unnecessary reposition

* fix: remove * path

* docs: fix route name

* fix: radar url

* fix: more maintainers

* fix: typo

* fix: last batch of empty maintainers

* feat!: remove biodiscover

* fix: correct eslint directive in data258 route
2026-07-29 09:25:19 +08:00

47 lines
1.4 KiB
TypeScript

import { load } from 'cheerio';
import { config } from '@/config';
import type { Route } from '@/types';
import cache from '@/utils/cache';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
export const route: Route = {
path: '/',
categories: ['program-update'],
example: '/fishshell',
radar: [
{
source: ['fishshell.com/'],
target: '',
},
],
name: 'Release Notes',
maintainers: ['x2cf'],
handler,
url: 'fishshell.com/',
};
async function handler() {
const link = 'https://fishshell.com/docs/current/relnotes.html';
const data = await cache.tryGet(link, async () => (await got(link)).data, config.cache.contentExpire, false);
const $ = load(data);
return {
link,
title: 'Release notes — fish-shell',
language: 'en',
item: $('#release-notes > section')
.toArray()
.map((item) => {
const title = $(item).find('h2').contents().first().text();
const date = title.match(/\(released (.+?)\)/)?.[1];
return {
title,
link: new URL($(item).find('a').attr('href'), link).href,
pubDate: date ? parseDate(date, 'MMMM D, YYYY') : undefined,
description: $(item).html(),
};
}),
};
}