diff --git a/archive-static-sites/x-archive/src/components/TweetComponent.vue b/archive-static-sites/x-archive/src/components/TweetComponent.vue index 93393d28..a5e95062 100644 --- a/archive-static-sites/x-archive/src/components/TweetComponent.vue +++ b/archive-static-sites/x-archive/src/components/TweetComponent.vue @@ -29,6 +29,16 @@ const quoteTweet = computed(() => { return archiveData.value.tweets.find(t => t.tweetID == tweetID); }); +// https://github.com/bluesky-social/atproto/discussions/2523#discussioncomment-9552109 +function atUriToBlueskyUrl(atUri: string): string { + const parts = atUri.split('/'); + if (!(parts.length === 5 && parts[0] === 'at:' && parts[1] === '')) { + throw new Error('Invalid AT URI'); + } + const did = parts[2]; + const rkey = parts[4]; + return `https://bsky.app/profile/${did}/post/${rkey}`; +}