Created
March 2, 2014 23:46
-
-
Save uyjulian/9315793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
if (!window.hasOwnProperty('tppuniquechatters')) { | |
var liveCount = $("#live-count"); | |
var uniqueChattersSpan = $("<span class=\"stat\" id=\"unique-count\" original-title=\"Unique Chatters\">~</span>"); | |
uniqueChattersSpan.insertBefore(liveCount); | |
var usernames = {}; | |
setInterval(function () { | |
$('#chat_line_list').find('.nick').each(function (i, e) { | |
var name = $(e).text(); | |
usernames[name] = (usernames[name] || 0) + 1; | |
}) | |
}, 500); | |
setInterval(function () { | |
$("#unique-count").text(Object.keys(usernames).length); | |
}, 1000); | |
window.tppuniquechatters = true; | |
} | |
}; | |
void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment