Something went wrong. Try again.
Makes your Mac trackpad purr like a cat purr.shenoi.dev
Something went wrong. Try again.
1234567891011121314151617181920212223// Serves site/ as static assets. The Worker only runs for paths with no asset, such as /download.// /download redirects to the newest Purr.dmg uploaded to the repo's tags on Tangled.// Tangled stores each artifact as a public record on the repo's knot; listRecords returns// the newest first.const REPO = "did:plc:x5uwjabusgrl5qkgxlx6ed5c";const RECORDS = `https://knot1.tangled.sh/xrpc/com.atproto.repo.listRecords?repo=${REPO}&collection=org.tangled.repo.artifact&limit=20`;const TANGLED = "https://tangled.org/shenoi.dev/purr";
export default { async fetch(request, env) { if (new URL(request.url).pathname !== "/download") return env.ASSETS.fetch(request); try { const res = await fetch(RECORDS, { cf: { cacheTtl: 300, cacheEverything: true } }); const { records } = await res.json(); const dmg = records.find((r) => r.value.name === "Purr.dmg"); return Response.redirect(`${TANGLED}/artifacts/${dmg.uri.split("/").pop()}`, 302); } catch { // The knot is down or has no DMG: send the visitor to the tags page. return Response.redirect(`${TANGLED}/tags`, 302); } },};