Stats: one-time import of StreamElements watch time
seimport.js reads the SE channel from SE_JWT, fetches /kappa/v2/points/<ch>/watchtime (all pages) into watch_import (login, minutes), replacing any previous import. Imported minutes count as watch time and watch points (5 per 5 min, merged by login) on the Stats page, leaderboards and viewer pages. Button on Stats warns that importing again after our own tracking started double-counts those streams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c364e7079b
commit
dd0e92c0bb
6 changed files with 95 additions and 5 deletions
|
|
@ -29,6 +29,7 @@
|
|||
.search input, .search button { margin:0; }
|
||||
.search button { width:auto; }
|
||||
.empty { color:var(--pico-muted-color); font-size:.85rem; font-style:italic; }
|
||||
.warn { color:#e6b800; }
|
||||
</style>
|
||||
|
||||
<div style="display:flex; align-items:center; gap:1rem; flex-wrap:wrap;">
|
||||
|
|
@ -44,6 +45,16 @@
|
|||
· <%= hiddenCount %> hidden bot<%= hiddenCount === 1 ? '' : 's' %> left out ⓘ
|
||||
</p>
|
||||
|
||||
<% if (msg) { %><p class="<%= /failed/i.test(msg) ? 'warn' : '' %>" style="font-weight:600;"><%= msg %></p><% } %>
|
||||
<% if (se.configured) { %>
|
||||
<form method="POST" action="/stats/import-se" style="display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; margin:.2rem 0 .8rem;">
|
||||
<button type="submit" class="outline" style="width:auto; margin:0; padding:.3rem .9rem; font-size:.85rem;"
|
||||
title="Copies StreamElements' watch time (per viewer) into HeyStreamer once. It counts like our own watch time (5 points per 5 minutes). Importing again replaces the previous import.<%= se.ownTicks ? ' HeyStreamer is already counting watch time itself: StreamElements has counted those streams too, so importing again now counts them twice.' : '' %>">
|
||||
<%= se.n ? 'Import again from StreamElements' : 'Import watch time from StreamElements' %></button>
|
||||
<span class="meta"><%= se.n ? `Imported ${se.n} viewers · ${Math.round(se.m / 60)} h on ${String(se.at).slice(0, 10)}` : 'Not imported yet: best done before the first stream HeyStreamer counts.' %>
|
||||
<% if (se.n && se.ownTicks) { %><span class="warn"> · importing again would double-count streams since then</span><% } %></span>
|
||||
</form>
|
||||
<% } %>
|
||||
<div class="tiles">
|
||||
<div class="tile"><div class="v"><%= overview.viewers.toLocaleString() %></div><div class="k">viewers seen</div></div>
|
||||
<div class="tile"><div class="v"><%= overview.messages.toLocaleString() %></div><div class="k">chat messages</div></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue