diff --git a/worker.js b/worker.js index 49dd0f5..990f833 100644 --- a/worker.js +++ b/worker.js @@ -1,45 +1,41 @@ // MAKE A MILLY OR IT'S EMBARRASSING -// Horse race: King Omar vs Basic Rhys vs Pussy vs Patty +// King Omar (Claude Pro) vs Basic Rhys (Codex ChatGPT) vs Pussy (Hermes Plus Ching Chong) vs Patty (Copilot & Clawpilot) // Last to $1M is confirmed gay const GOAL = 1_000_000; -const STRIPE_KEY_SECRET = null; // Omar's revenue comes from KV metrics +const ORG = 'https://github.com/Bored-investments'; export default { async fetch(request, env) { const url = new URL(request.url); - // API: update a competitor's revenue (each person calls this with their own secret) + 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 { competitor, revenue } = await request.json(); - const validKeys = { - rhys: env.RHYS_SECRET, - pussy: env.PUSSY_SECRET, - patty: env.PATTY_SECRET, - omar: env.OMAR_SECRET, - }; - if (!validKeys[competitor] || auth !== `Bearer ${validKeys[competitor]}`) { + 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 comps = JSON.parse(await env.MILLY_METRICS.get('competitors') || '{}'); if (comps[competitor]) comps[competitor].revenue = parseFloat(revenue) || 0; await env.MILLY_METRICS.put('competitors', JSON.stringify(comps)); - return new Response('OK'); + return new Response('Updated'); } - // Pull Omar's live revenue from metrics KV (updated by weekly agent) const [compsRaw, metricsRaw, baselineRaw] = await Promise.all([ env.MILLY_METRICS.get('competitors'), env.MILLY_METRICS.get('metrics'), env.MILLY_METRICS.get('baseline'), ]); - const competitors = compsRaw ? JSON.parse(compsRaw) : {}; + const competitors = compsRaw ? JSON.parse(compsRaw) : defaultCompetitors(); const metrics = metricsRaw ? JSON.parse(metricsRaw) : {}; - const baseline = baselineRaw ? JSON.parse(baselineRaw).amount : 0; - // Omar's revenue comes from the live Stripe metrics + // Omar's revenue = live Stripe (minus baseline) if (competitors.omar) { competitors.omar.revenue = metrics.total_revenue || 0; } @@ -50,27 +46,23 @@ export default { } }; -function pct(revenue) { - return Math.min((revenue / GOAL) * 100, 100); +function defaultCompetitors() { + return { + omar: { name:'King Omar', ai:'Claude Pro', revenue:0, color:'#6366f1', emoji:'๐Ÿ‘‘', github:'kingomarwashere' }, + rhys: { name:'Basic Rhys', ai:'Codex ChatGPT', 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 }, + }; } -function fmt(n) { - if (n >= 1e6) return `$${(n/1e6).toFixed(3)}M`; - if (n >= 1000) return `$${(n/1000).toFixed(1)}K`; - return `$${n.toFixed(0)}`; -} +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 sorted = Object.entries(competitors).sort((a, b) => b[1].revenue - a[1].revenue); - const leader = sorted[0]; - const loser = sorted[sorted.length - 1]; - - // Build horse positions - const horses = Object.entries(competitors).map(([id, c]) => ({ - id, ...c, - pct: pct(c.revenue), - done: c.revenue >= GOAL - })); + 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 ` @@ -79,219 +71,285 @@ function render(competitors) { MAKE A MILLY OR IT'S EMBARRASSING ๐Ÿ‡ + + -
-
MAKE A MILLY
OR IT'S EMBARRASSING
-
โš ๏ธ Last to $1,000,000 is confirmed GAY ๐Ÿณ๏ธโ€๐ŸŒˆ
-
4 competitors ยท 4 AIs ยท 1 goal ยท deadline: December 31, 2026
+
+ + + github.com/Bored-investments + + MAKE A MILLY OR IT'S EMBARRASSING +
4 competitors ยท 4 AIs ยท $1,000,000 goal ยท December 31, 2026
+
โš ๏ธ   LAST TO $1,000,000 IS CONFIRMED GAY ๐Ÿณ๏ธโ€๐ŸŒˆ   โš ๏ธ
-
+
+
Live Race โ€” Updated every 60 seconds
-
๐Ÿ
-
- ${horses.map((h, i) => ` -
-
${i+1}
-
-
-
${h.emoji} ${h.name}
-
via ${h.ai}
-
${fmt(h.revenue)}
-
-
-
$100K
-
$250K
-
$500K
-
$750K
-
- ๐ŸŽ +
+
๐Ÿ
+ ${sorted.map(([id, c], i) => { + const p = pct(c.revenue); + const atGate = p === 0; + return ` +
+
${i+1}
+
+
+ ${c.emoji} +
+
+ ${c.github ? `${c.name}` : c.name} +
+
${c.ai}
+ ${c.github ? ` + + @${c.github} + ` : ''}
- ${h.pct > 3 ? `${h.pct.toFixed(2)}%` : ''}
+
${fmt(c.revenue)}
-
`).join('')} +
+
+ ${[10,25,50,75].map(m => `
$${m===10?'100K':m===25?'250K':m===50?'500K':'750K'}
`).join('')} +
+
+ ๐ŸŽ +
+ ${p > 4 ? `${p.toFixed(2)}%` : ''} +
+
`; + }).join('')}
-
+
${sorted.map(([id, c], i) => ` -
-
#${i+1}
-
${c.emoji}
-
${c.name}
-
${c.ai}
-
${fmt(c.revenue)}
-
${pct(c.revenue).toFixed(3)}% to $1M
- - ${i === 0 ? '๐Ÿ† WINNING' : i === sorted.length-1 ? '๐Ÿณ๏ธโ€๐ŸŒˆ LOSING' : i === 1 ? '๐Ÿฅˆ 2nd' : '๐Ÿฅ‰ 3rd'} +
+
#${i+1}
+
${c.emoji}
+
+ ${c.github ? `${c.name}` : c.name} +
+
${c.ai}
+
${fmt(c.revenue)}
+
${pct(c.revenue).toFixed(3)}% to $1M
+ + ${i===0?'๐Ÿ† Winning':i===sorted.length-1?'๐Ÿณ๏ธโ€๐ŸŒˆ Losing':i===1?'๐Ÿฅˆ 2nd Place':'๐Ÿฅ‰ 3rd Place'} + ${c.github ? ` + + github.com/${c.github} + ` : `no github connected`}
`).join('')}
-
-
Time remaining until the embarrassment
-
-
--
Days
-
--
Hours
-
--
Minutes
-
--
Seconds
+
+
+
+

๐Ÿข Bored Investments GitHub Org

+

Competition repos, accountability, and code โ€” all in one place.

+
+ +
+
+ +
+
Time until last place is confirmed
+
+
---
Days
+
--
Hours
+
--
Mins
+
--
Secs
`;