import { json } from '@remix-run/cloudflare'; import type { ActionFunctionArgs } from '@remix-run/cloudflare'; import { isAllowedUrl } from '~/utils/url'; const MAX_CONTENT_LENGTH = 8000; const FETCH_HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-US,en;q=0.5', }; function extractTitle(html: string): string { const match = html.match(/