This repository has been archived on 2023-09-29. You can view files and clone it, but cannot push or open issues or pull requests.
twitch_data_collector/static/overlay.js

19 lines
411 B
JavaScript
Raw Normal View History

function showData(data) {
2020-05-12 14:13:41 +02:00
if (!data) {
console.error("Data is empty");
return;
}
2020-05-12 14:13:41 +02:00
if (!data.Followers) {
console.error("No followers data found");
return;
}
2020-05-12 14:13:41 +02:00
const followers = document.getElementById("followers");
followers.innerHTML = data.Followers.total;
}
2020-05-12 14:13:41 +02:00
const collector = new TwitchCollector();
collector.registerHook("update", showData);
collector.start();