tangled
alpha
login
or
join now
jordanreger.com
/
htmlsky
0
fork
atom
An HTML-only Bluesky frontend
0
fork
atom
overview
issues
pulls
pipelines
renamed profile to actor
ImOutOfIdeas
2 years ago
bf8af611
1675782d
+22
-16
3 changed files
expand all
collapse all
unified
split
main.ts
page.ts
profile.ts
+3
-3
main.ts
···
1
1
-
import Profile from "./profile.ts";
1
1
+
import Actor from "./profile.ts";
2
2
3
3
Deno.serve(async (req) => {
4
4
const url = new URL(req.url);
···
16
16
if (profilePattern.test(url)) {
17
17
const actorName = profilePattern.exec(url)?.pathname.groups.actor!;
18
18
19
19
-
const profile = new Profile(actorName);
19
19
+
const actor = new Actor(actorName);
20
20
21
21
-
return new Response(await profile.generateProfile(), headers);
21
21
+
return new Response(await actor.generateActor(), headers);
22
22
}
23
23
24
24
/* Redirect to homepage */
+9
-1
page.ts
···
1
1
-
export default class Page {}
1
1
+
export default class Page {
2
2
+
handle: string;
3
3
+
4
4
+
constructor(handle: string) {
5
5
+
this.handle = handle;
6
6
+
}
7
7
+
8
8
+
generatePage
9
9
+
}
+10
-12
profile.ts
···
3
3
4
4
const agent = new AtpAgent({ service: "https://public.api.bsky.app" });
5
5
6
6
-
export default class Profile extends Page {
6
6
+
export default class Actor extends Page {
7
7
handle: string;
8
8
9
9
constructor(handle: string) {
10
10
-
super();
10
10
+
super(handle);
11
11
this.handle = handle;
12
12
}
13
13
14
14
-
async generateProfile() {
14
14
+
async generateActor() {
15
15
const { data } = await agent.api.app.bsky.actor.getProfile({
16
16
actor: this.handle,
17
17
});
···
37
37
<sup><sup><small><small>@${handle}</small></small></sup></sup>
38
38
</h1>
39
39
</nobr>
40
40
-
<small>
41
41
-
<span>
42
42
-
<nobr>
43
43
-
Followers <strong>${followersCount}</strong>
44
44
-
Following <strong>${followsCount}</strong>
45
45
-
Posts <strong>${postsCount}</strong>
46
46
-
</nobr>
47
47
-
</span>
48
48
-
<small>
40
40
+
<span>
41
41
+
<nobr>
42
42
+
Followers <strong>${followersCount}</strong>
43
43
+
Following <strong>${followsCount}</strong>
44
44
+
Posts <strong>${postsCount}</strong>
45
45
+
</nobr>
46
46
+
</span>
49
47
</td>
50
48
<td> </td>
51
49
<td valign="bottom" align="left">