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