Add feed sharing

This commit is contained in:
Paul Frazee 2023-05-18 16:22:11 -05:00
parent 84990c509e
commit 1ecf0da81b
5 changed files with 141 additions and 48 deletions

View file

@ -82,6 +82,18 @@ export function isBskyPostUrl(url: string): boolean {
return false
}
export function isBskyCustomFeedUrl(url: string): boolean {
if (isBskyAppUrl(url)) {
try {
const urlp = new URL(url)
return /profile\/(?<name>[^/]+)\/feed\/(?<rkey>[^/]+)/i.test(
urlp.pathname,
)
} catch {}
}
return false
}
export function convertBskyAppUrlIfNeeded(url: string): string {
if (isBskyAppUrl(url)) {
try {