diff --git a/preview/check-live.mjs b/preview/check-live.mjs index c2a8105..6df48a9 100644 --- a/preview/check-live.mjs +++ b/preview/check-live.mjs @@ -109,6 +109,27 @@ async function main() { } catch {} } + const oi = process.argv.indexOf('--open') + if (oi >= 0) { + const seatId = process.argv[oi + 1] + const order = { lead: 0, zhongshu: 1, shangshu: 2, menxia: 3, libu: 4, hubu: 5, lipu: 6, bingbu: 7, xingbu: 8, gongbu: 9 } + const idx = order[seatId] + if (idx !== undefined) { + const clicked = await evaluate(`(() => { const s = document.querySelectorAll('.ssw-seat'); if (s[${idx}]) { s[${idx}].click(); return true } return false })()`) + const noticeEarly = await evaluate("document.querySelector('.ssw-notice')?.innerText?.trim() ?? null") + await sleep(1800) + result.open = await evaluate(`(() => ({ + mainText: (document.querySelector('main')?.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 320), + composer: (document.querySelector('.composer')?.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 120), + title: document.title, + }))()`) + result.open.seatId = seatId + result.open.clicked = clicked + result.open.noticeEarly = noticeEarly + await shot('live-07-' + seatId + '-session.png') + } + } + if (process.argv.includes('--each')) { result.each = [] const n = await evaluate("document.querySelectorAll('.ssw-seat').length") diff --git a/preview/live-07-lipu-session.png b/preview/live-07-lipu-session.png new file mode 100644 index 0000000..7a65fbf Binary files /dev/null and b/preview/live-07-lipu-session.png differ