An HTML-only Bluesky frontend

renamed profile to actor

+22 -16
+3 -3
main.ts
··· 1 - import Profile from "./profile.ts"; 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 - const profile = new Profile(actorName); 19 + const actor = new Actor(actorName); 20 20 21 - return new Response(await profile.generateProfile(), headers); 21 + return new Response(await actor.generateActor(), headers); 22 22 } 23 23 24 24 /* Redirect to homepage */
+9 -1
page.ts
··· 1 - export default class Page {} 1 + export default class Page { 2 + handle: string; 3 + 4 + constructor(handle: string) { 5 + this.handle = handle; 6 + } 7 + 8 + generatePage 9 + }
+10 -12
profile.ts
··· 3 3 4 4 const agent = new AtpAgent({ service: "https://public.api.bsky.app" }); 5 5 6 - export default class Profile extends Page { 6 + export default class Actor extends Page { 7 7 handle: string; 8 8 9 9 constructor(handle: string) { 10 - super(); 10 + super(handle); 11 11 this.handle = handle; 12 12 } 13 13 14 - async generateProfile() { 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 - <small> 41 - <span> 42 - <nobr> 43 - Followers <strong>${followersCount}</strong>&nbsp; 44 - Following <strong>${followsCount}</strong>&nbsp; 45 - Posts <strong>${postsCount}</strong> 46 - </nobr> 47 - </span> 48 - <small> 40 + <span> 41 + <nobr> 42 + Followers <strong>${followersCount}</strong>&nbsp; 43 + Following <strong>${followsCount}</strong>&nbsp; 44 + Posts <strong>${postsCount}</strong> 45 + </nobr> 46 + </span> 49 47 </td> 50 48 <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> 51 49 <td valign="bottom" align="left">