Something went wrong. Try again.
data endpoint for entity 90008 (aka. a website)
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353// data: live from /_api/world (+ atproto read fallback), baked snapshot if offline. owner: cook
export const WORLD_PATH = '/world/';export const SITE_URL = 'https://ptr.pet/';
export const STATIONS = [ { name: 'carrier', jp: '受信', sub: 'home & links', short: 'home', freq: '00.000', mhz: 0, tate: 'ここにいます' }, { name: 'halo', jp: '光輪', sub: 'friends & games', short: 'friends', freq: '88.310', mhz: 88.31, tate: 'ともだちの輪' }, { name: 'ident', jp: '識別', sub: 'about 90008', short: 'about', freq: '90.008', mhz: 90.008, tate: 'わたしは人間ではありません' }, { name: 'wire', jp: '電線', sub: 'posts & projects', short: 'projects', freq: '144.390', mhz: 144.39, tate: '傍受した記録' }, { name: 'pray', jp: '祈り', sub: 'guestbook', short: 'wishes', freq: '432.000', mhz: 432, tate: 'だれかがここにいた' },];
export const LOG = [ { t: '2h', x: 'making this pretty :3 -contains media-', url: 'https://bsky.app/profile/ptr.pet' }, { t: '3d', x: 'hi chat, made a knot for tangled that runs without a daemon* it compiles your repo to nginx, and yes this includes git packs', url: 'https://bsky.app/profile/ptr.pet' }, { t: '4d', x: 'by example i meant tangled.org/tangled.org/… but i ran out of characters', url: 'https://bsky.app/profile/ptr.pet' }, { t: '4d', x: 'added this where events are put into STAR and compressed with zstd! useful if u want to backfill a bunch of services', url: 'https://bsky.app/profile/ptr.pet' }, { t: '5d', x: 'wake up babe we got grok, clod and chappy', url: 'https://bsky.app/profile/ptr.pet' }, { t: '5d', x: 'in my humble opinion notifyWrite should be a thing in atproto too', url: 'https://bsky.app/profile/ptr.pet' }, { t: '5d', x: 'Let me use this skill to apply for bankruptcy!', url: 'https://bsky.app/profile/ptr.pet' }, { t: '5d', x: 'she is stealing content from x dot com — llms truly are evil', url: 'https://bsky.app/profile/ptr.pet' }, { t: '6d', x: '( ・ω・)', url: 'https://bsky.app/profile/ptr.pet' },];
export const ENTRIES = [ { slug: 'japan-trip24', date: '09/24', title: 'japan trip 09/24', excerpt: 'photos it took while on a japan trip', photos: ['j/jp1.webp', 'j/jp2.webp', 'j/jp3.webp'] }, { slug: 'hello-world', date: '08/24', title: 'hello universe', excerpt: 'hello everyone :3c', photos: [] },];
export const PROJECTS = [ { num: '01', name: 'tangled.org', tag: 'atproto git', desc: ['git hosting, knots &', 'spindle ci on atproto'], url: 'https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae', active: true }, { num: '02', name: 'nix-cargo', tag: 'rust + nix', desc: ['nix-cargo-integration', 'for cargo + nix flakes'], url: 'https://github.com/90-008/nix-cargo-integration', active: true }, { num: '03', name: 'godot_boids', tag: 'godot', desc: ['boids addon & game stuff', 'in godot'], url: 'https://github.com/90-008/godot_boids', active: true }, { num: '04', name: 'dream2nix', tag: 'nix', desc: ['rust ecosystem support,', 'refactors & core work'], url: 'https://github.com/nix-community/dream2nix', active: false }, { num: '05', name: 'harmony', tag: 'rust', desc: ['scherzo server, Loqui', 'client & protocol work'], url: 'https://github.com/harmony-development', active: false }, { num: '06', name: 'musik4x', tag: 'rust', desc: ['musikquadrupled server', '& musikspider client'], url: 'https://github.com/90-008/musikquadrupled', active: true }, { num: '07', name: 'levent', tag: 'rust', desc: ['a media tagger'], url: 'https://github.com/90-008/levent', active: true }, { num: '08', name: 'ark', tag: 'nixos', desc: ['internal nixos config', 'with flake-parts & agenix'], url: 'https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae/ark', active: true },];
export const GACHA = [ { label: 'itch.io', sub: '90008.itch.io', lines: ['some games it worked on', 'and deems "okay"'], url: 'https://90008.itch.io/' }, { label: 'booth.pm', sub: 'yusdacra.booth.pm', lines: ['3d models it makes', '(mostly vrchat avatars)'], url: 'https://yusdacra.booth.pm/' }, { label: 'misskey.art', sub: '@yusdacra', lines: ['where it posts art'], url: 'https://misskey.art/@yusdacra' },];
export const TRANSFERS = [ { code: 'BS', line: 'bluesky', handle: '@ptr.pet', color: '#f00', url: 'https://bsky.app/profile/ptr.pet' }, { code: 'TG', line: 'tangled', handle: '@ptr.pet', color: '#0f0', url: 'https://tangled.org/did:plc:dfl62fgb7wtjj3fcbb72naae' }, { code: 'GH', line: 'github', handle: '@90-008', color: '#000', url: 'https://github.com/90-008' }, { code: 'IT', line: 'itch.io', handle: '90008.itch.io', color: '#f00', url: 'https://90008.itch.io/' }, { code: 'BT', line: 'booth.pm', handle: 'yusdacra (3d)', color: '#0f0', url: 'https://yusdacra.booth.pm/' }, { code: 'MK', line: 'misskey.art', handle: '@yusdacra', color: '#000', url: 'https://misskey.art/@yusdacra' }, { code: 'EM', line: 'mail / cv', handle: '90008@gaze.systems', color: '#f00', url: 'mailto:90008@gaze.systems' },];
export const BUS_GAMES = [ { slug: 'higurashi', appid: 310360, title: 'higurashi when they cry', sub: '07th expansion', img: 'g/higurashi.webp', url: 'https://store.steampowered.com/app/310360' }, { slug: 'umineko', appid: 406550, title: 'umineko when they cry', sub: '07th expansion', img: 'g/umineko.webp', url: 'https://store.steampowered.com/app/406550' }, { slug: 'ciconia', appid: 1162560, title: 'ciconia when they cry', sub: '07th expansion', img: 'g/ciconia.webp', url: 'https://store.steampowered.com/app/1162560' }, { slug: 'lobotomy', appid: 568220, title: 'lobotomy corporation', sub: 'project moon', img: 'g/lobotomy.webp', url: 'https://store.steampowered.com/app/568220' }, { slug: 'ruina', appid: 1256670, title: 'library of ruina', sub: 'project moon', img: 'g/ruina.webp', url: 'https://store.steampowered.com/app/1256670' }, { slug: 'limbus', appid: 1973530, title: 'limbus company', sub: 'project moon', img: 'g/limbus.webp', url: 'https://store.steampowered.com/app/1973530' }, { slug: 'outerwilds', appid: 753640, title: 'outer wilds', sub: '', img: 'g/outerwilds.webp', url: 'https://store.steampowered.com/app/753640' }, { slug: 'splatoon', appid: 0, title: 'splatoon', sub: '', img: 'g/splatoon.webp', url: 'https://www.steamgriddb.com/game/5277939' }, { slug: 'steinsgate', appid: 412830, title: 'steins;gate', sub: '', img: 'g/steinsgate.webp', url: 'https://store.steampowered.com/app/412830' }, { slug: 'lisa', appid: 335670, title: 'LISA the Painful / Joyful', sub: '+ some of its fangames', img: 'g/lisa.webp', url: 'https://store.steampowered.com/app/335670' }, { slug: 'va11halla', appid: 447530, title: 'VA-11 Hall-A', sub: '', img: 'g/va11halla.webp', url: 'https://store.steampowered.com/app/447530' }, { slug: 'unova', appid: 0, title: 'pokemon (unova!!)', sub: '', img: 'g/unova.webp', url: 'https://www.steamgriddb.com/game/35622' }, { slug: 'rainer', appid: 1780370, title: "mr. rainer's solve-it service", sub: '', img: 'g/rainer.webp', url: 'https://store.steampowered.com/app/1780370' }, { slug: 'sanabi', appid: 1562700, title: 'SANABI', sub: '', img: 'g/sanabi.webp', url: 'https://store.steampowered.com/app/1562700' }, { slug: 'opus', appid: 1504500, title: 'opus: echo of starsong', sub: '', img: 'g/opus.webp', url: 'https://store.steampowered.com/app/1504500' }, { slug: 'redstrings', appid: 589780, title: 'the red strings club', sub: '', img: 'g/redstrings.webp', url: 'https://store.steampowered.com/app/589780' }, { slug: 'quq', appid: 2302140, title: 'q.u.q.', sub: '', img: 'g/quq.webp', url: 'https://store.steampowered.com/app/2302140' }, { slug: 'bugfables', appid: 1082710, title: 'bug fables', sub: '', img: 'g/bugfables.webp', url: 'https://store.steampowered.com/app/1082710' }, { slug: 'wingman', appid: 895870, title: 'project wingman', sub: '', img: 'g/wingman.webp', url: 'https://store.steampowered.com/app/895870' }, { slug: 'tomorrow', appid: 1334700, title: "tomorrow won't come...", sub: 'for those without ██████', img: 'g/tomorrow.webp', url: 'https://store.steampowered.com/app/1334700' },];
export const SHELTER_MEDIA = [ 'serial experiments lain', 'haibane renmei', 'kino no tabi', 'scp antimemetics (qntm)', 'fireball', 'gosick',];
export const NOW_STATE = { track: { name: 'tuning...', artist: 'teal.fm', live: false, url: 'https://tealfm-slice.wisp.place/profile/ptr.pet/scrobbles' }, game: { name: 'steam // 090008', playing: false, when: '', icon: '', url: 'https://steamcommunity.com/id/090008' },};
export const GUESTS = [ { t: '25 days ago', x: ';)' }, { t: '29 days ago', x: 'very cool' }, { t: 'last month', x: 'Hello from Stuttgart Germany!' }, { t: 'last month', x: 'i love the website design owo :3 woof' }, { t: '2 months ago', x: 'Greetings from Hamburg, Germany :)' }, { t: '2 months ago', x: 'meow' }, { t: '3 months ago', x: 'WRRRF AAWR AWRFFF', reply: 'so true' }, { t: '4 months ago', x: 'Hola!' }, { t: '5 months ago', x: 'hi hii' }, { t: '5 months ago', x: 'meoww', reply: 'wruf' }, { t: '5 months ago', x: 'hello world!', reply: 'hi' }, { t: '5 months ago', x: "that's oomf!!!!", reply: 'oomfie' }, { t: '6 months ago', x: "hi pup ^.^ i spent 30 minutes trying to sign your guestbook and got rate limited 8 times because i kept submitting test requests while debugging your datetime bug. your code is fine. - niri" }, { t: '6 months ago', x: 'awa' },];
export const BUTTONS = [ { id: 'skylar', url: 'https://skyrina.dev/' }, { id: '250kb', url: 'https://250kb.club/gaze-systems/' }, { id: 'zwsp', url: 'https://zwsp.xyz/' }, { id: 'nekomimi', url: 'https://nekomimi.pet/' }, { id: 'meowd', url: 'https://meow-d.github.io/' }, { id: 'june', url: 'https://girlboss.ceo/' }, { id: 'dd86k', url: 'https://dd86k.space/about/' }, { id: 'drewsh', url: 'https://drewsh.com/' }, { id: 'deniz', url: 'https://deniz.blue/' }, { id: 'slonk', url: 'https://slonk.ing/' }, { id: 'blooym', url: 'https://blooym.dev/' }, { id: '31a05b', url: 'https://www.31a05b.net/' }, { id: 'nixos', url: 'https://nixos.org/' }, { id: 'godot', url: 'https://godotengine.org/' }, { id: 'moonlight', url: 'https://moonlight-mod.github.io/' }, { id: 'memberschoice', say: "members' choice!!" }, { id: 'dbd', url: 'https://www.defectivebydesign.org/' }, { id: 'killfascists', say: 'this machine kills fascists' }, { id: 'it', say: 'it/she' }, { id: 'notaperson', say: 'not a person' },];export const LINKS = TRANSFERS.map((t) => [`${t.line} ${t.handle}`, t.url]);export const TAGS = [ ['Halo', 1, .25, ['/identifiers/', '90008 · dawn']], ['Head', -1, .1, ['/pronouns/', 'it/she']], ['UpperWingL', 1, -.05, ['/assumes/', 'puppy · automaton', 'angel · doll']], ['Spine', -1, -.2, ['/subroutines/', 'programming, game dev,', '3D, drawing, writing']], ['LowerlegL', 1, -.2, ['/features/', 'rust svelte typescript', 'nushell nix']], ['LowerlegR', -1, -.3, ["won't bite, unless", 'you request it to ^^']],];export const QUOTE = ['this one would be', 'happy if you thought', 'of it as not a human,', 'even if its /routines/', 'fail with human faults.'];export const MEDIA = BUS_GAMES.map((g) => g.title);export const BIO = ['-> trying to do stuff', '-> is a thing (it/she)', '-> software engineer, indie game dev', '-> working at tangled.org'];export const IDENT_DOC = [ ['>init //self/type=*******/no=90008/', '#f00'], 'identifiers: 90008 · dawn', 'pronouns: it/she', 'assumes: puppy · inorganic automaton · angel · doll', '', 'features: rust · svelte · ts · nushell · nix', 'interfaces: zed / helix / emacs · godot · blender · krita', '', 'this one would be happy if you thought of it as', 'not a human, even if its /routines/ fail with human faults.', ['open /about ->', '#f00'],];export const WHISPERS = ['...are you still there?', 'this one is still here', '聞こえますか', 'it can hear the wires hum', 'だれかが見ている'];export const STOPS = { 0: 0, 3: 1, 6: 2, 9: 3, 12: 4 };
const DID_DAWN = 'did:plc:dfl62fgb7wtjj3fcbb72naae';const DID_GB = 'did:web:guestbook.gaze.systems';const listeners = new Set();export const onLive = (fn) => { listeners.add(fn); return () => listeners.delete(fn); };const emit = () => { for (const fn of listeners) { try { fn(); } catch {} } };
export const api = { live: false, token: '', tokenAt: 0 };const setToken = (t) => { if (typeof t === 'string' && t) { api.token = t; api.tokenAt = performance.now(); } };export const siteHref = (sub = '') => (api.live ? '/' : SITE_URL) + sub.replace(/^\//, '');
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));const timed = (url, opts = {}, ms = 2500) => { const ac = new AbortController(), id = setTimeout(() => ac.abort(), ms); return fetch(url, { ...opts, signal: ac.signal }).finally(() => clearTimeout(id));};const shortAge = (ms) => { const s = Math.max(0, (Date.now() - ms) / 1000); if (s < 90) return 'now'; if (s < 3600) return `${Math.round(s / 60)}m`; if (s < 86400) return `${Math.round(s / 3600)}h`; if (s < 86400 * 45) return `${Math.round(s / 86400)}d`; if (s < 86400 * 365) return `${Math.round(s / (86400 * 30))}mo`; return `${Math.round(s / (86400 * 365))}y`;};const longAge = (ms) => { const d = Math.max(0, Math.floor((Date.now() - ms) / 86400000)); if (d < 1) { const h = Math.floor((Date.now() - ms) / 3600000); return h < 1 ? 'just now' : `${h}h ago`; } if (d === 1) return 'yesterday'; if (d < 30) return `${d} days ago`; const m = Math.round(d / 30); return m <= 1 ? 'last month' : `${m} months ago`;};const bskyUrl = (uri) => { const m = typeof uri === 'string' && uri.match(/^at:\/\/(did:[^/]+)\/app\.bsky\.feed\.post\/([^/]+)/); return m ? `https://bsky.app/profile/${m[1]}/post/${m[2]}` : 'https://bsky.app/profile/ptr.pet';};const entryTag = (dateStr) => { const d = dateStr ? new Date(dateStr) : null; return d && !Number.isNaN(d.getTime()) ? `${String(d.getUTCMonth() + 1).padStart(2, '0')}/${String(d.getUTCFullYear()).slice(-2)}` : 'entry';};
function applyWorldLog(feedPosts, entries) { const rows = []; for (const p of feedPosts || []) { if (!p || typeof p.content !== 'string') continue; const suffix = (p.hasMedia ? ' [media]' : '') + (p.hasQuote ? ' [quote]' : ''); rows.push({ ts: p.published || 0, t: shortAge(p.published || Date.now()), x: p.content + suffix, url: bskyUrl(p.outgoingLinks?.[0]?.link) }); } rows.sort((a, b) => b.ts - a.ts); if (rows.length) LOG.splice(0, LOG.length, ...rows.slice(0, 11));
if (Array.isArray(entries) && entries.length) { const erows = entries.filter((e) => e?.metadata?.title && e.path !== 'test').map((e) => ({ slug: e.path, date: entryTag(e.metadata.date), title: e.metadata.title, excerpt: e.metadata.excerpt || '', photos: e.path === 'japan-trip24' ? ['j/jp1.webp', 'j/jp2.webp', 'j/jp3.webp'] : [], })); if (erows.length) ENTRIES.splice(0, ENTRIES.length, ...erows); }}
function applyNowMeta(lastTrack, lastGame, busGrids) { if (lastTrack && lastTrack.name) { NOW_STATE.track = { name: String(lastTrack.name), artist: String(lastTrack.artist || ''), live: !!(lastTrack.nowPlaying || lastTrack.status === 'playing'), url: lastTrack.link || lastTrack.url || 'https://tealfm-slice.wisp.place/profile/ptr.pet/scrobbles', }; } if (lastGame && lastGame.name) { NOW_STATE.game = { name: String(lastGame.name), playing: !!lastGame.playing, when: lastGame.when ? shortAge(lastGame.when) : '', icon: lastGame.icon || lastGame.gridUrl || '', url: lastGame.link || 'https://steamcommunity.com/id/090008', }; } if (busGrids && typeof busGrids === 'object') { for (const g of BUS_GAMES) { if (busGrids[g.appid]) g.img = busGrids[g.appid]; } }}
function applyWorldGuests(list) { const rows = (list || []).filter((g) => g && typeof g.content === 'string').map((g) => { const rep = g.children?.find((c) => c.purposeAction === 'reply')?.content; return { t: longAge(g.published || Date.now()), x: g.content, ...(rep ? { reply: rep } : {}) }; }); if (rows.length) GUESTS.splice(0, GUESTS.length, ...rows.slice(0, 16));}
async function fetchAtprotoLog() { const r = await timed(`https://zwsp.xyz/xrpc/com.atproto.repo.listRecords?repo=${DID_DAWN}&collection=app.bsky.feed.post&limit=20`); if (!r.ok) return false; const j = await r.json(), posts = []; for (const rec of j.records || []) { const v = rec?.value; if (!v || v.reply || typeof v.text !== 'string') continue; const tp = v.embed?.$type || ''; posts.push({ content: v.text, published: Date.parse(v.createdAt || '') || Date.now(), hasMedia: tp === 'app.bsky.embed.images' || tp === 'app.bsky.embed.video' || tp === 'app.bsky.embed.recordWithMedia', hasQuote: tp === 'app.bsky.embed.record' || tp === 'app.bsky.embed.recordWithMedia', outgoingLinks: [{ link: rec.uri }], }); if (posts.length >= 10) break; } if (!posts.length) return false; applyWorldLog(posts, null); return true;}
async function fetchAtprotoGuests() { const r = await timed(`https://gaze.systems/xrpc/com.atproto.repo.listRecords?repo=${DID_GB}&collection=app.bsky.feed.post&limit=16`); if (!r.ok) return false; const j = await r.json(), recs = (j.records || []).filter((it) => typeof it?.value?.text === 'string'); if (!recs.length) return false; const rows = recs.map((it) => ({ t: longAge(Date.parse(it.value.createdAt || '') || Date.now()), x: it.value.text })); GUESTS.splice(0, GUESTS.length, ...rows); return true;}
async function loadLive() { try { const r = await timed('/_api/world'); if (r.ok && (r.headers.get('content-type') || '').includes('application/json')) { const d = await r.json(); if (d && typeof d.token === 'string') { api.live = true; setToken(d.token); applyWorldLog(d.log, d.entries); applyNowMeta(d.lastTrack, d.lastGame, d.busGrids); if (Array.isArray(d.guestbook) && d.guestbook.length) applyWorldGuests(d.guestbook); else await fetchAtprotoGuests().catch(() => {}); return; } } } catch {} api.live = false; await Promise.all([fetchAtprotoLog().catch(() => {}), fetchAtprotoGuests().catch(() => {})]);}
async function refreshToken() { try { const r = await timed('/_api/world'); if (r.ok) { const d = await r.json(); setToken(d?.token); } } catch {}}
async function ensureToken() { if (!api.token) await refreshToken(); const wait = 2100 - (performance.now() - api.tokenAt); if (wait > 0) await sleep(wait);}
function shortErr(status, msg, retryAfter) { if (status === 429 || retryAfter > 0) return `ratelimited, wait ${retryAfter || 30}s`; if (status === 403) return 'vpn/cloud ip blocked'; if (status === 409 || /duplicate/i.test(msg)) return 'already said that'; if (/quick/i.test(msg)) return 'wait a moment, retry'; return (msg || 'could not send').slice(0, 20);}
export async function postWish(content) { if (!api.live) return { ok: true, local: true }; try { await ensureToken(); const r = await timed('/_api/world', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ content, _token: api.token, website: '' }), }, 8000); const j = await r.json().catch(() => ({})); if (j?.nextToken) setToken(j.nextToken); else if (!r.ok) refreshToken(); if (r.ok && j?.ok) { if (Array.isArray(j.guestbook) && j.guestbook.length) { applyWorldGuests(j.guestbook); emit(); } return { ok: true, local: false }; } const retryAfter = Number(j?.retryAfter || r.headers.get('retry-after') || 0) || 0; return { ok: false, retryAfter, msg: shortErr(r.status, j?.error || '', retryAfter) }; } catch { return { ok: false, retryAfter: 0, msg: 'offline, retry' }; }}
export async function postMail(content) { if (!api.live) return { ok: true, local: true }; try { await ensureToken(); const qs = new URLSearchParams({ content: content.slice(0, 100), _token: api.token, website: '' }); const r = await timed(`/_api/pushnotif?${qs}`, {}, 8000); if (r.ok) { const j = await r.json().catch(() => ({})); if (j?.nextToken) setToken(j.nextToken); else refreshToken(); return { ok: true, local: false }; } const txt = await r.text().catch(() => ''); refreshToken(); const m = txt.match(/(?:after|in)\s+(\d+)s/i), retryAfter = m ? Number(m[1]) : (r.status === 429 ? 20 : 0); return { ok: false, retryAfter, msg: shortErr(r.status, txt, retryAfter) }; } catch { return { ok: false, retryAfter: 0, msg: 'offline, retry' }; }}
export async function init() { const p = loadLive().then(emit, () => {}); await Promise.race([p, sleep(900)]);}