mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-13 22:29:48 +08:00
10 lines
297 B
TypeScript
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];
|
|
}
|
|
|