tiny whitewind client

just do slingshot anyways

+10 -14
+10 -14
index.php
··· 18 18 $converter = new MarkdownConverter($environment); 19 19 20 20 // short circuit if no other user is specified 21 - $me = "benharri.org"; 22 - $my_pds = "https://hellthread.pro"; 23 - $user = $_GET["user"] ?? $me; 24 - $pds = @$_GET["pds"]; 21 + $user = $_GET["user"] ?? "benharri.org"; 25 22 $format = $_GET["format"] ?? "html"; 26 23 27 - if ($user !== $me && empty($pds)) { 28 - $slingshot = json_decode(file_get_contents("https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc?identifier=$user")); 29 - $pds = $slingshot->pds; 30 - } 24 + $slingshot = json_decode(file_get_contents("https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc?identifier=$user")); 25 + $pds = $slingshot->pds; 26 + $did = $slingshot->did; 27 + $handle = $slingshot->handle; 31 28 32 - $pds ??= $my_pds; 33 - $user_url = "?pds=$pds&user=$user"; 34 - $at_uri = "at://$user/com.whtwnd.blog.entry"; 29 + $user_url = "?user=$handle"; 30 + $at_uri = "at://$handle/com.whtwnd.blog.entry"; 35 31 36 32 if (isset($_GET["p"])) { 37 33 // get single post record 38 34 $query = http_build_query([ 39 - "repo" => $user, 35 + "repo" => $did, 40 36 "collection" => "com.whtwnd.blog.entry", 41 37 "rkey" => $_GET["p"] 42 38 ]); ··· 58 54 // get all posts 59 55 // TODO: pagination 60 56 $q = http_build_query([ 61 - "repo" => $user, 57 + "repo" => $did, 62 58 "collection" => "com.whtwnd.blog.entry", 63 59 "limit" => 100 64 60 ]); ··· 78 74 <link rel="alternate" type="text/markdown; variant=GFM" href="https://bhh.sh/pub/atblog/<?=$post_url?>&format=markdown"> 79 75 <?php } ?> 80 76 <link rel="alternate" href="<?=$at_uri?>"> 81 - <title>atblog: <?=$post["value"]["title"] ?? $did_doc->alsoKnownAs[0] ?? $user?></title> 77 + <title>atblog: <?=$post["value"]["title"] ?? $handle?></title> 82 78 </head> 83 79 84 80 <body>