some files for the teal.town personal data server.

swap to microcosm slingshot

+29 -17
+10 -6
index.html
··· 19 19 const PDS_URL = "teal.town"; 20 20 // --- fetch server info --- 21 21 const serverInfo = await fetch( 22 - `https://${PDS_URL}/xrpc/com.atproto.server.describeServer` 22 + `https://${PDS_URL}/xrpc/com.atproto.server.describeServer`, 23 23 ) 24 24 .then((r) => r.json()) 25 25 .catch(() => ({})); ··· 38 38 dids.map(async (did) => { 39 39 try { 40 40 const url = new URL( 41 - "https://slingshot.mmatt.net/xrpc/com.bad-example.identity.resolveMiniDoc" 41 + "https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc", 42 42 ); 43 43 url.searchParams.set("identifier", did); 44 - const res = await fetch(url).then((r) => r.json()); 44 + const res = await fetch(url, { 45 + headers: { 46 + "User-Agent": "teal.town-homepage/1.0", 47 + }, 48 + }).then((r) => r.json()); 45 49 return { handle: res.handle || null, did }; 46 50 } catch { 47 51 return null; 48 52 } 49 - }) 53 + }), 50 54 ); 51 55 52 56 const valid = handles.filter(Boolean); ··· 82 86 const padded = plain.padEnd(offset, " "); 83 87 const html = padded.replace( 84 88 links.privacyPolicy, 85 - `<a href="${links.privacyPolicy}">${links.privacyPolicy}</a>` 89 + `<a href="${links.privacyPolicy}">${links.privacyPolicy}</a>`, 86 90 ); 87 91 lines.push(html + ` \\ o / `); 88 92 } ··· 91 95 const padded = plain.padEnd(offset, " "); 92 96 const html = padded.replace( 93 97 links.termsOfService, 94 - `<a href="${links.termsOfService}">${links.termsOfService}</a>` 98 + `<a href="${links.termsOfService}">${links.termsOfService}</a>`, 95 99 ); 96 100 lines.push(html + `๐Ÿ’ผ |`); 97 101 }
+19 -11
me.html
··· 23 23 try { 24 24 // Resolve handle to DID and get full handle 25 25 const resolveUrl = new URL( 26 - "https://slingshot.mmatt.net/xrpc/com.bad-example.identity.resolveMiniDoc" 26 + "https://slingshot.microcosm.blue/xrpc/com.bad-example.identity.resolveMiniDoc", 27 27 ); 28 28 resolveUrl.searchParams.set("identifier", handle); 29 - const resolveRes = await fetch(resolveUrl) 29 + const resolveRes = await fetch(resolveUrl, { 30 + headers: { 31 + "User-Agent": "teal.town-me/1.0", 32 + }, 33 + }) 30 34 .then((r) => r.json()) 31 35 .catch(() => null); 32 36 ··· 64 68 // Build output 65 69 const lines = []; 66 70 lines.push( 67 - `this user isn't from this neighborhood, they can be found at ${pdsDisplay}` 71 + `this user isn't from this neighborhood, they can be found at ${pdsDisplay}`, 68 72 ); 69 73 lines.push(``); 70 74 lines.push(`<a href="https://teal.town">๐Ÿ  go home</a>`); 71 75 lines.push( 72 - `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>` 76 + `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>`, 73 77 ); 74 78 75 79 const pre = document.getElementById("out"); ··· 80 84 // Fetch profile information from slingshot 81 85 const profileUri = `at://${did}/app.bsky.actor.profile/self`; 82 86 const profileUrl = new URL( 83 - "https://slingshot.mmatt.net/xrpc/com.bad-example.repo.getUriRecord" 87 + "https://slingshot.microcosm.blue/xrpc/com.bad-example.repo.getUriRecord", 84 88 ); 85 89 profileUrl.searchParams.set("at_uri", profileUri); 86 - const profileRes = await fetch(profileUrl) 90 + const profileRes = await fetch(profileUrl, { 91 + headers: { 92 + "User-Agent": "teal.town-me/1.0", 93 + }, 94 + }) 87 95 .then((r) => r.json()) 88 96 .catch(() => null); 89 97 ··· 141 149 lines.push(``); 142 150 143 151 lines.push( 144 - `<a href="https://bsky.app/profile/${did}">๐Ÿฆ‹ bluesky profile</a>` 152 + `<a href="https://bsky.app/profile/${did}">๐Ÿฆ‹ bluesky profile</a>`, 145 153 ); 146 154 lines.push( 147 - `<a href="https://pdsls.dev/at://${did}">๐Ÿ“ pdsls link</a>` 155 + `<a href="https://pdsls.dev/at://${did}">๐Ÿ“ pdsls link</a>`, 148 156 ); 149 157 150 158 if (avatarUrl) { 151 159 lines.push( 152 - `<img src="${avatarUrl}" alt="profile picture" style="display: block; max-width: 200px; margin: 1em 0;" />` 160 + `<img src="${avatarUrl}" alt="profile picture" style="display: block; max-width: 200px; margin: 1em 0;" />`, 153 161 ); 154 162 } 155 163 156 164 lines.push(`<a href="https://teal.town">๐Ÿ  go home</a>`); 157 165 lines.push( 158 - `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>` 166 + `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>`, 159 167 ); 160 168 161 169 const pre = document.getElementById("out"); ··· 167 175 lines.push(``); 168 176 lines.push(`<a href="https://teal.town">๐Ÿ  go home</a>`); 169 177 lines.push( 170 - `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>` 178 + `<a href="https://pdsmoover.com/moover/teal.town">๐Ÿšš move to town</a>`, 171 179 ); 172 180 173 181 const pre = document.getElementById("out");