From 41f611de8eb6503083eaba7ec81272216db54715 Mon Sep 17 00:00:00 2001 From: Tsung-Han Yu <14802181+johan456789@users.noreply.github.com> Date: Wed, 17 Sep 2025 10:06:13 +0800 Subject: [PATCH] feat(route): add google jules (#20074) --- lib/routes/google/jules.ts | 63 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 lib/routes/google/jules.ts 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