tangled
alpha
login
or
join now
benharri.org
/
atblog
2
fork
atom
tiny whitewind client
2
fork
atom
overview
issues
pulls
pipelines
just do slingshot anyways
benharri.org
7 months ago
614d892e
900a6cc0
+10
-14
1 changed file
expand all
collapse all
unified
split
index.php
+10
-14
index.php
···
18
18
$converter = new MarkdownConverter($environment);
19
19
20
20
// short circuit if no other user is specified
21
21
-
$me = "benharri.org";
22
22
-
$my_pds = "https://hellthread.pro";
23
23
-
$user = $_GET["user"] ?? $me;
24
24
-
$pds = @$_GET["pds"];
21
21
+
$user = $_GET["user"] ?? "benharri.org";
25
22
$format = $_GET["format"] ?? "html";
26
23
27
27
-
if ($user !== $me && empty($pds)) {
28
28
-
$slingshot = json_decode(file_get_contents("https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc?identifier=$user"));
29
29
-
$pds = $slingshot->pds;
30
30
-
}
24
24
+
$slingshot = json_decode(file_get_contents("https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc?identifier=$user"));
25
25
+
$pds = $slingshot->pds;
26
26
+
$did = $slingshot->did;
27
27
+
$handle = $slingshot->handle;
31
28
32
32
-
$pds ??= $my_pds;
33
33
-
$user_url = "?pds=$pds&user=$user";
34
34
-
$at_uri = "at://$user/com.whtwnd.blog.entry";
29
29
+
$user_url = "?user=$handle";
30
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
39
-
"repo" => $user,
35
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
61
-
"repo" => $user,
57
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
81
-
<title>atblog: <?=$post["value"]["title"] ?? $did_doc->alsoKnownAs[0] ?? $user?></title>
77
77
+
<title>atblog: <?=$post["value"]["title"] ?? $handle?></title>
82
78
</head>
83
79
84
80
<body>