This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 1.2 kB View raw
1// Probe knot1.tangled.sh to discover the real XRPC endpoint names/paths. 2const repo = "did:plc:qsctypxlsrippb5wculrsj7q"; // had a cached languages snapshot 3const host = "knot1.tangled.sh"; 4 5const candidates = [ 6 `/xrpc/sh.tangled.repo.languages?repo=${repo}`, 7 `/xrpc/sh.tangled.repo.branches?repo=${repo}&limit=100`, 8 `/xrpc/sh.tangled.repo.getDefaultBranch?repo=${repo}`, 9 `/xrpc/sh.tangled.git.temp.getTree?repo=${repo}&ref=HEAD&path=`, 10 `/xrpc/sh.tangled.git.temp.getTree?repo=${repo}&ref=main&path=`, 11 `/xrpc/sh.tangled.git.temp.getEntry?repo=${repo}&ref=HEAD&path=README.md`, 12 `/xrpc/sh.tangled.git.listRefs?repo=${repo}`, 13 `/xrpc/sh.tangled.git.temp.listBranches?repo=${repo}`, 14]; 15 16for (const path of candidates) { 17 const url = `https://${host}${path}`; 18 try { 19 const ctrl = new AbortController(); 20 const t = setTimeout(() => ctrl.abort(), 10000); 21 const resp = await fetch(url, { signal: ctrl.signal, headers: { accept: "application/json" } }); 22 clearTimeout(t); 23 const txt = await resp.text(); 24 console.log(`[${resp.status}] ${path}`); 25 console.log(` -> ${txt.slice(0, 240).replace(/\n/g, " ")}`); 26 } catch (e) { 27 console.log(`[ERR] ${path} -> ${e.name}:${e.message}`); 28 } 29}