diff --git a/lib/routes/google/jules.ts b/lib/routes/google/jules.ts new file mode 100644 index 000000000..f3ff756ae --- /dev/null +++ b/lib/routes/google/jules.ts @@ -0,0 +1,63 @@ +import { Route } from '@/types'; +import ofetch from '@/utils/ofetch'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; + +export const route: Route = { + path: '/jules/changelog', + categories: ['program-update'], + example: '/google/jules/changelog', + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + name: 'Jules Changelog', + url: 'jules.google/docs/changelog/', + maintainers: ['johan456789'], + handler, +}; + +async function handler() { + const url = 'https://jules.google/docs/changelog/'; + const html = await ofetch(url); + const $ = load(html); + + const items = $('main article') + .toArray() + .map((el) => { + const article = $(el); + const h2 = article.find('h2').first(); + const id = h2.attr('id') || article.attr('id'); + const title = h2.text().trim(); + const anchor = id ? `${url}#${id}` : url; + // Date appears as a bold text node after h2 (no