mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Updated some stuff hey
This commit is contained in:
1 parent
57485f6ffd
commit
d9eac44b35
24 files changed
+292
-57
No files matched your search
@@ -4,6 +4,15 @@
|
||||
<div>
|
||||
<select id="series">
|
||||
<option value="">Today</option>
|
||||
<option value="_2016_10">Oct 2016</option>
|
||||
<option value="_2016_09">Sep 2016</option>
|
||||
<option value="_2016_08">Aug 2016</option>
|
||||
<option value="_2016_07">July 2016</option>
|
||||
<option value="_2016_06">June 2016</option>
|
||||
<option value="_2016_05">May 2016</option>
|
||||
<option value="_2016_04">Apr 2016</option>
|
||||
<option value="_2016_03">Mar 2016</option>
|
||||
<option value="_2016_02">Feb 2016</option>
|
||||
<option value="_2016_01">Jan 2016</option>
|
||||
<option value="_2015_12">Dec 2015</option>
|
||||
<option value="_2015_11">Nov 2015</option>
|
||||
|
||||
@@ -11,12 +11,21 @@ charset="utf-8"></script>-->
|
||||
<script type="text/javascript">
|
||||
google.load("visualization", "1.1", {packages:["table"]});
|
||||
|
||||
data = [];
|
||||
|
||||
$(loadData);
|
||||
|
||||
function loadData() {
|
||||
|
||||
data = [];
|
||||
brutalMode = $("#onlyReal").is(":checked");
|
||||
|
||||
jQuery.getJSON("/~krowbar/data/chatStats.json", function(json) {
|
||||
now = new Date();
|
||||
nowSec = Math.round(now.getTime()/1000)
|
||||
_.forEach(json, function(userData, user) {
|
||||
if(brutalMode && (userData.mentions < 3 || userData.lineCount < 20)) {
|
||||
return;
|
||||
}
|
||||
data.push([user, new Date(userData.startTime*1000), new Date(userData.endTime*1000),
|
||||
Number(((userData.endTime - userData.startTime) / 86400).toFixed(2)),
|
||||
userData.daysActive,
|
||||
@@ -30,12 +39,16 @@ charset="utf-8"></script>-->
|
||||
(userData.mentions / userData.lineCount),
|
||||
userData.botUse,
|
||||
Number((userData.responseTime / (userData.mentions ? userData.mentions : 1) / 60).toFixed(2)),
|
||||
userData.happyEmotes,
|
||||
userData.sadEmotes,
|
||||
(userData.happyEmotes + userData.sadEmotes) == 0 ? 0 : userData.happyEmotes / (userData.happyEmotes + userData.sadEmotes)
|
||||
]);
|
||||
});
|
||||
console.log("* Loaded the data!");
|
||||
//google.setOnLoadCallback(drawTable);
|
||||
$(drawTable)
|
||||
});
|
||||
}
|
||||
|
||||
function drawTable() {
|
||||
|
||||
@@ -65,6 +78,9 @@ charset="utf-8"></script>-->
|
||||
dataTable.addColumn('number', 'by Line'); //col14
|
||||
dataTable.addColumn('number', 'Bot Use'); //col15
|
||||
dataTable.addColumn('number', 'Response time'); //col16
|
||||
dataTable.addColumn('number', 'Happy'); //col17
|
||||
dataTable.addColumn('number', 'Sad'); //col18
|
||||
dataTable.addColumn('number', 'Ratio'); //col19
|
||||
|
||||
dataTable.addRows(data);
|
||||
userFormatter.format(dataTable, [0]);
|
||||
@@ -84,6 +100,7 @@ charset="utf-8"></script>-->
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<input id="onlyReal" type="checkbox" onClick="loadData()">Only real people</input>
|
||||
<div id="statTable"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -26,7 +26,7 @@
|
||||
title: 'Tilder Disk Usage',
|
||||
subtitle: 'in kb',
|
||||
pieHole: 0.4,
|
||||
sliceVisibilityThreshold: 0.01
|
||||
sliceVisibilityThreshold: 0.005
|
||||
};
|
||||
var lineoptions = {
|
||||
title: 'Tilder Disk Usage',
|
||||
@@ -48,10 +48,13 @@
|
||||
//Draw LineChart
|
||||
linedata.addColumn('date', 'Date');
|
||||
var userData = {};
|
||||
|
||||
var cutoffDate = new Date(); cutoffDate.setMonth(cutoffDate.getMonth() - 6); cutoffDate = cutoffDate.getTime() / 1000; //the last 3 months
|
||||
|
||||
_.forEach(json, function(set, idx) {
|
||||
//only display 1/8 the points. (every 2 days instead of every 6 hours) page is loading too slow
|
||||
//maybe i could add something to show more points but we're not losing too much granularity for the speed we gain
|
||||
if(idx % 8 != 0) return;
|
||||
if(idx % 4 != 0 || set.date < cutoffDate) return;
|
||||
_.forEach(set.data, function(point) {
|
||||
if(point.du > 5000) { //the 'interesting' threshold is set at 5000kb
|
||||
if(!userData[point.user]) { //if the current user has not been initialized yet
|
||||
@@ -73,10 +76,10 @@
|
||||
})
|
||||
})
|
||||
_.forEach(json, function(set,idx) {
|
||||
if(idx % 8 != 0) return;
|
||||
var d = new Date(0);
|
||||
d.setUTCSeconds(set.date);
|
||||
linedata.addRow([d].concat(_.map(userData, function(user) { return user[idx];})));
|
||||
if(idx % 4 != 0) return;
|
||||
var d = new Date(0);
|
||||
d.setUTCSeconds(set.date);
|
||||
linedata.addRow([d].concat(_.map(userData, function(user) { return user[idx];})));
|
||||
});
|
||||
console.log(linedata);
|
||||
linechart.draw(linedata, lineoptions);
|
||||
@@ -86,5 +89,5 @@
|
||||
</script>
|
||||
<body>
|
||||
<div id="donutchart" style="width: 700px; height: 400px;"></div>
|
||||
<div id="linechart" style="width: 1200px; height: 1200px;"></div>
|
||||
<div id="linechart" style="width: 120%; height: 130%; margin-left: -10%"></div>
|
||||
</body>
|
||||
@@ -5,6 +5,7 @@
|
||||
<body>
|
||||
Links and stuff
|
||||
<ul>
|
||||
<li><a href="mc/">Minecraft</a></li>
|
||||
<li><a href="chatchecker/">Tilde.town IRC Chat checker</a></li>
|
||||
<li><a href="chatstats/">IRC User Chat Statistics</a></li>
|
||||
<li><a href="besties/">IRC Chat Bestie Nodes</a></li>
|
||||
|
||||
Reference in new issue
Block a user