Files
baoyu-skills/skills/baoyu-url-to-markdown/scripts/lib/adapters/x/match.ts
T
2026-04-21 13:39:09 -05:00

10 lines
297 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];
}