From e0fb466c36e7bd4caafd8f4c989745f4bbc175ec Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 22 Feb 2026 21:47:10 -0500 Subject: [PATCH] use URI not URL in content extraction and CLAUDE.md style guide --- CLAUDE.md | 1 + public/src/content.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d7d809e..c5baf05 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -615,3 +615,4 @@ openai==2.3.0 ## Style - **Never use "AI" — always say "machine learning."** We grow machine learning, not "AI." This term is forbidden in all permacomputer discourse, marketing, & documentation. +- **Use "URI" not "URL."** URI is the correct general term. URL is a subset. Default to URI in code, comments, and documentation. diff --git a/public/src/content.js b/public/src/content.js index 5093487..d0e59b4 100644 --- a/public/src/content.js +++ b/public/src/content.js @@ -1,8 +1,8 @@ // Content extraction and processing functionality -// URL translation rules — map dynamic page patterns to raw/plain text equivalents. -// Each rule: { pattern: RegExp matching the full URL, translate: (match) => rawURL } -const URL_TRANSLATIONS = [ +// URI translation rules — map dynamic page patterns to raw/plain text equivalents. +// Each rule: { pattern: RegExp matching the full URI, translate: (match) => rawURI } +const URI_TRANSLATIONS = [ { // GitLab CI job pages → raw log output // e.g. https://git.example.com/group/project/-/jobs/12345 → .../jobs/12345/raw @@ -11,16 +11,16 @@ const URL_TRANSLATIONS = [ }, ]; -// Try to fetch raw content via URL translation (same-origin, cookies included). +// Try to fetch raw content via URI translation (same-origin, cookies included). // Returns { raw: string } on success, { matched: true } if pattern matched but // fetch failed (signals a dynamic page worth waiting for), or null if no match. -async function fetchTranslatedContent(url) { - for (const rule of URL_TRANSLATIONS) { - const match = url.match(rule.pattern); +async function fetchTranslatedContent(uri) { + for (const rule of URI_TRANSLATIONS) { + const match = uri.match(rule.pattern); if (match) { try { - const rawUrl = rule.translate(match); - const response = await fetch(rawUrl, { credentials: "same-origin" }); + const rawUri = rule.translate(match); + const response = await fetch(rawUri, { credentials: "same-origin" }); if (response.ok) { const text = await response.text(); if (text && text.length > 0) { @@ -28,7 +28,7 @@ async function fetchTranslatedContent(url) { } } } catch (e) { - console.warn("URL translation fetch failed, falling back to DOM:", e); + console.warn("URI translation fetch failed, falling back to DOM:", e); } // Pattern matched but fetch failed — caller should wait for DOM to settle return { matched: true }; @@ -108,7 +108,7 @@ function extractDOMContent() { } // Extract text content along with links and metadata from the webpage. -// Tries URL translation first (raw/plain text for known dynamic pages), +// Tries URI translation first (raw/plain text for known dynamic pages), // falls back to DOM extraction. export async function extractWebpageContent() { const result = await fetchTranslatedContent(window.location.href); @@ -120,7 +120,7 @@ export async function extractWebpageContent() { if (title) { content += `**Page Title**: ${title}\n\n`; } - content += `**Source URL**: ${window.location.href}\n\n`; + content += `**Source URI**: ${window.location.href}\n\n`; content += result.raw; return content.trim(); }