Files
agent-skills/baoyu-skills/skills/baoyu-url-to-markdown/scripts/lib/adapters/x/match.ts
2026-09-13 07:37:15 +08:00

10 lines
306 B
TypeScript

export function isXHost(hostname: string): boolean {
return ["x.com", "www.x.com", "twitter.com", "www.twitter.com"].includes(hostname);
}
export function extractStatusId(url: URL): string | undefined {
const match = url.pathname.match(/\/(?:status|article)\/(\d+)/);
return match?.[1];
}