305bd435fa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.8 KiB
Python
26 lines
1.8 KiB
Python
# Cross-promo strip (Marty, 2026-10-03): "More games" in the lobby, from InstantAdPay's shared list.
|
|
ROOT = 'D:/Projects/HighRisk/drip-runner/'
|
|
def edit(path, pairs):
|
|
b = open(ROOT + path, 'rb').read(); crlf = b.count(b'\r\n') > b.count(b'\n') // 2
|
|
s = b.decode('utf-8').replace('\r\n', '\n')
|
|
for a, r in pairs:
|
|
if s.count(a) != 1: raise SystemExit('%s anchor %d: %s' % (path, s.count(a), a[:70]))
|
|
s = s.replace(a, r)
|
|
if crlf: s = s.replace('\n', '\r\n')
|
|
open(ROOT + path, 'wb').write(s.encode('utf-8')); print('patched', path)
|
|
|
|
edit('server.js', [("img-src 'self' data:; connect-src", "img-src 'self' data: https:; connect-src")]) # other games' share art in the strip
|
|
edit('public/play.html', [
|
|
('<div class="member" style="margin-top:6px"><a id="lIap"',
|
|
'<div id="moreGames" class="moreGames" hidden></div>\n <div class="member" style="margin-top:6px"><a id="lIap"'),
|
|
('<script src="https://instantadpay.com/assets/game-signin.js?v=20261003a" async></script>',
|
|
'<script src="https://instantadpay.com/assets/game-signin.js?v=20261003a" async></script>\n<script src="https://instantadpay.com/assets/game-strip.js?v=20261003a"></script>'),
|
|
('[hidden]{display:none!important}', '.moreGames{margin-top:16px;--gs-ink:var(--ink);--gs-muted:var(--ink2);--gs-card:var(--panel2);--gs-line:var(--line);--gs-hot:var(--gold);--gs-font:var(--body)}\n[hidden]{display:none!important}'),
|
|
])
|
|
edit('public/play.js', [
|
|
(" [['lIap', 'overview'], ['bLevel', 'buy']].forEach(",
|
|
" if (window.IAPGames && !$('moreGames').dataset.done) { $('moreGames').dataset.done = 1; IAPGames.strip($('moreGames'), { current: 'driprunner', title: 'More games that pay POL' }); } // cross-promo strip (2026-10-03)\n"
|
|
" [['lIap', 'overview'], ['bLevel', 'buy']].forEach("),
|
|
])
|
|
print('ok')
|