File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 99 },
1010 'icGetBlueskyUrl ' => function () {
1111 $ mastodonSender = new BlueskySender ();
12- return $ mastodonSender ->getPostTargetUrl ('bluesky ' , $ this );
12+ $ atUri = $ mastodonSender ->getPostTargetUrl ('bluesky ' , $ this );
13+
14+ // Regular expression to match the DID and RKEY
15+ $ regex = '/^at:\/\/(did:plc:[a-zA-Z0-9]+)\/app\.bsky\.feed\.post\/([a-zA-Z0-9]+)$/ ' ;
16+
17+ // Check if the AT-URI matches the pattern
18+ if (preg_match ($ regex , $ atUri , $ matches )) {
19+ // Extract DID and RKEY from the matched groups
20+ $ did = $ matches [1 ]; // Group 1: DID
21+ $ rkey = $ matches [2 ]; // Group 2: RKEY
22+
23+ // Generate the Bluesky post URL
24+ return "https://bsky.app/profile/ $ did/post/ $ rkey " ;
25+ }
26+
27+ return $ atUri ;
1328 },
1429];
You can’t perform that action at this time.
0 commit comments