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
|
|
@ -20,7 +20,7 @@
|
|||
<p class="meta">No statistics for this viewer (yet). Names are Twitch logins, e.g. <code>channel</code>.</p>
|
||||
<% } else {
|
||||
const hm = m => m >= 60 ? `${Math.floor(m / 60)} h ${m % 60} m` : `${m} m`;
|
||||
const minutes = (viewer.watch.ticks || 0) * 5; %>
|
||||
const minutes = (viewer.watch.ticks || 0) * 5 + (viewer.importedMinutes || 0); %>
|
||||
<h2 style="margin-bottom:.2rem;"><%= viewer.name %> <span class="meta">@<%= viewer.login %></span></h2>
|
||||
<p class="meta"><%= viewer.level.name %>
|
||||
<% if (viewer.hidden) { %> · <span class="badge badge-grey" title="In Settings → Hidden chatters: counted, but not shown in leaderboards">hidden bot</span><% } %>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
<div class="card">
|
||||
<div class="tiles">
|
||||
<div class="tile"><div class="v"><%= viewer.total.toLocaleString() %></div><div class="k">points</div></div>
|
||||
<div class="tile"><div class="v"><%= hm(minutes) %></div><div class="k">watched</div></div>
|
||||
<div class="tile" title="<%= viewer.importedMinutes ? `includes ${hm(viewer.importedMinutes)} imported from StreamElements` : '' %>"><div class="v"><%= hm(minutes) %></div><div class="k">watched<%= viewer.importedMinutes ? ' · incl. StreamElements' : '' %></div></div>
|
||||
<div class="tile"><div class="v"><%= (viewer.chat.messages || 0).toLocaleString() %></div><div class="k">chat messages</div></div>
|
||||
<div class="tile"><div class="v"><%= viewer.checkins %></div><div class="k">check-ins</div></div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue