diff --git a/lib/routes/webcatalog/changelog.ts b/lib/routes/webcatalog/changelog.ts new file mode 100644 index 00000000000000..c5b9788115ab6b --- /dev/null +++ b/lib/routes/webcatalog/changelog.ts @@ -0,0 +1,59 @@ +import { Route } from '@/types'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import ofetch from '@/utils/ofetch'; + +export const route: Route = { + path: '/changelog', + categories: ['program-update'], + example: '/webcatalog/changelog', + parameters: {}, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['desktop.webcatalog.io/:lang/changelog'], + }, + ], + name: 'Changelog', + maintainers: ['Tsuyumi25'], + handler, + url: 'desktop.webcatalog.io/en/changelog', +}; + +async function handler() { + const url = 'https://desktop.webcatalog.io/en/changelog'; + const response = await ofetch(url); + const $ = load(response); + + // remove What's new + $('.container article div.mb-20').remove(); + const items = $('.container article') + .html() + ?.split('