// MAKE A MILLY OR IT'S EMBARRASSING // King Omar (Claude Pro) vs Basic Rhys (Codex) vs Pussy (Hermes Plus Ching Chong) vs Patty (Copilot & Clawpilot) // Last to $1M is confirmed gay const GOAL = 1_000_000; const ORG = 'https://github.com/Bored-investments'; export default { async fetch(request, env) { const url = new URL(request.url); if (url.pathname === '/favicon.ico') return new Response(null, { status: 204 }); // API: competitor revenue update if (url.pathname === '/update' && request.method === 'POST') { const auth = request.headers.get('Authorization'); const body = await request.json(); const { competitor, revenue } = body; const secrets = { rhys: env.RHYS_SECRET, pussy: env.PUSSY_SECRET, patty: env.PATTY_SECRET, omar: env.OMAR_SECRET }; if (!secrets[competitor] || auth !== `Bearer ${secrets[competitor]}`) { return new Response('Unauthorized', { status: 401 }); } const revenues = JSON.parse(await env.MILLY_METRICS.get('revenues') || '{}'); revenues[competitor] = parseFloat(revenue) || 0; await env.MILLY_METRICS.put('revenues', JSON.stringify(revenues)); return new Response('Updated'); } const [revenuesRaw, metricsRaw] = await Promise.all([ env.MILLY_METRICS.get('revenues'), env.MILLY_METRICS.get('metrics'), ]); // Static config always comes from code โ KV only stores revenue numbers const competitors = defaultCompetitors(); const revenues = revenuesRaw ? JSON.parse(revenuesRaw) : {}; const metrics = metricsRaw ? JSON.parse(metricsRaw) : {}; // Omar's revenue = live Stripe competitors.omar.revenue = metrics.total_revenue || 0; // Others = self-reported via /update API for (const id of ['rhys', 'pussy', 'patty']) { if (revenues[id] != null) competitors[id].revenue = revenues[id]; } return new Response(render(competitors), { headers: { 'Content-Type': 'text/html;charset=UTF-8', 'Cache-Control': 'no-store' } }); } }; function defaultCompetitors() { return { omar: { name:'King Omar', ai:'Claude Pro', revenue:0, color:'#6366f1', emoji:'๐', github:'kingomarwashere' }, rhys: { name:'Basic Rhys', ai:'Codex', revenue:0, color:'#f59e0b', emoji:'๐ค', github:'rhy-collab' }, pussy: { name:'Pussy', ai:'Hermes Plus Ching Chong',revenue:0, color:'#ec4899', emoji:'๐ฑ', github:'QuixThe2nd' }, patty: { name:'Patty', ai:'Copilot & Clawpilot', revenue:0, color:'#10b981', emoji:'๐ค ', github:null }, }; } const fmt = n => n >= 1e6 ? `$${(n/1e6).toFixed(3)}M` : n >= 1000 ? `$${(n/1000).toFixed(1)}K` : `$${n.toFixed(0)}`; const pct = r => Math.min((r / GOAL) * 100, 100); function render(competitors) { const entries = Object.entries(competitors); const sorted = [...entries].sort((a, b) => b[1].revenue - a[1].revenue); const leaderId = sorted[0][0]; const loserId = sorted[sorted.length - 1][0]; return `
Competition repos, accountability, and code โ all in one place.