mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Some recent changes and stuff
This commit is contained in:
1 parent
ebb5f2fe37
commit
86916fb5fa
18 files changed
+321
-30
No files matched your search
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Who chats and when?</title>
|
||||
</head>
|
||||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
|
||||
charset="utf-8"></script>-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript">
|
||||
google.load("visualization", "1", {packages:["timeline"]});
|
||||
|
||||
data = [];
|
||||
jQuery.getJSON("/~krowbar/data/userData.json", function(json) {
|
||||
_.forEach(json, function(times, user) {
|
||||
console.log("~" + user + ":", times.length, "item(s)");
|
||||
_.forEach(times, function(time) {
|
||||
d = new Date(0);
|
||||
d.setUTCSeconds(Number(time));
|
||||
<!--data.push([user, d.toISOString().slice(11,16), d, d]);-->
|
||||
data.push([user, d, d]);
|
||||
})
|
||||
});
|
||||
google.setOnLoadCallback(drawChart);
|
||||
});
|
||||
|
||||
function drawChart() {
|
||||
var container = document.getElementById('timeline');
|
||||
var chart = new google.visualization.Timeline(container);
|
||||
var dataTable = new google.visualization.DataTable();
|
||||
|
||||
dataTable.addColumn({ type: 'string', id: 'User' });
|
||||
<!--dataTable.addColumn({ type: 'string', id: 'tooltip' });-->
|
||||
dataTable.addColumn({ type: 'date', id: 'Start' });
|
||||
dataTable.addColumn({ type: 'date', id: 'End' });
|
||||
dataTable.addRows(data);
|
||||
|
||||
chart.draw(dataTable);
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<div id="timeline" style="height: 800px;"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
|
||||
How do do stuff
|
||||
|
||||
Data structure
|
||||
users["name"]
|
||||
.talked = array of irc times
|
||||
.mentioned = array of irc times
|
||||
|
||||
|
||||
DATA DAEMON
|
||||
* Parse log for nicks that said something
|
||||
- Populate data structure
|
||||
* For each line, log the person who talked
|
||||
- Check if any other person was mentioned
|
||||
- Only log if it is at least 1 minute past their last chat/reference (maybe
|
||||
to reduce data size)
|
||||
* Write to log file
|
||||
- Same file or dated one?
|
||||
- Only certain time frames??
|
||||
* Run daily/hourly?
|
||||
|
||||
PRESENTATION
|
||||
* Select a user name from the drop down
|
||||
- See a timeline with colored strands of when they spoke and were mentioned
|
||||
* Something that looks like the Github commit history
|
||||
* Use D3 for coolness
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>IRC chat stats</title>
|
||||
</head>
|
||||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
|
||||
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"
|
||||
charset="utf-8"></script>-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript">
|
||||
google.load("visualization", "1.1", {packages:["table"]});
|
||||
|
||||
data = [];
|
||||
jQuery.getJSON("/~krowbar/data/chatStats.json", function(json) {
|
||||
_.forEach(json, function(userData, user) {
|
||||
data.push([user, new Date(userData.startTime*1000), new Date(userData.endTime*1000),
|
||||
Number(((userData.endTime - userData.startTime) / 86400).toFixed(2)), userData.lineCount,
|
||||
userData.wordCount, Number((userData.wordCount / userData.lineCount).toFixed(2)),
|
||||
userData.charCount, Number((userData.charCount / userData.lineCount).toFixed(2))]);
|
||||
});
|
||||
google.setOnLoadCallback(drawTable);
|
||||
});
|
||||
|
||||
function drawTable() {
|
||||
|
||||
var dataTable = new google.visualization.DataTable();
|
||||
|
||||
dataTable.addColumn('string', 'User');
|
||||
dataTable.addColumn('datetime', 'Start');
|
||||
dataTable.addColumn('datetime', 'End');
|
||||
dataTable.addColumn('number', 'Days Active');
|
||||
dataTable.addColumn('number', 'Lines');
|
||||
dataTable.addColumn('number', 'Words');
|
||||
dataTable.addColumn('number', 'per Line');
|
||||
dataTable.addColumn('number', 'Characters');
|
||||
dataTable.addColumn('number', 'per Line');
|
||||
|
||||
dataTable.addRows(data);
|
||||
|
||||
var table = new google.visualization.Table(document.getElementById('statTable'));
|
||||
|
||||
table.draw(dataTable, {showRowNumber: false, width:'80%', height: '60%', sortColumn:2, sortAscending:false});
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<div id="statTable"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,9 +6,10 @@
|
||||
Links and stuff
|
||||
<ul>
|
||||
<li><a href="chatchecker/">Tilde.town IRC Chat checker</a></li>
|
||||
<li><a href="chatstats/">IRC User Chat Statistics</a></li>
|
||||
<li><a href="twine2/">Twine 2.0</a></li>
|
||||
<li><a href="grimoire/app/">Grimoire: The Pathfinder Item Roller</a></li>
|
||||
<li><a href="https://github.com/RussellChamp/PragmaticDiceBag">Pragmatic Dice Bag</a></li>
|
||||
<li><a href="https://github.com/RussellChamp/PragmaticDiceBag">Pragmatic Dice Bag: Artsy fartsy guide!</a></li>
|
||||
</ul>
|
||||
|
||||
<h2><a href="chatcloud/">Tilde.town IRC Chat cloud</a></h2>
|
||||
|
||||
@@ -7,24 +7,24 @@
|
||||
|
||||
var self = this;
|
||||
|
||||
var adjectives = Array('Bold','Breaking','Brilliant','Crescent','Dark|Darkness','Desert|Desert','Eternal','Evening|Darkness','Final','First','Forever','Glorious','Joyful','July','Last','Libery|Liberty','Magic|Magic','Morning|Morning','Power|Power','Phantom','Present','Roaring|Roar|Scream','Rolling','Sand','Screaming|Roar|Scream','Soaring','Standing|Stand','Star|Star','Twisted','Urgent','Utopian','Valiant');
|
||||
var adjectives = Array('Bold','Breaking','Brilliant','Crescent','Dark|Darkness','Desert|Desert','Eternal','Evening|Darkness','Final','First','Forever','Glorious','Joyful','July','Last','Liberty|Liberty','Magic|Magic','Morning|Morning','Power|Power','Phantom','Present','Roaring|Roar|Scream','Rolling','Sand','Screaming|Roar|Scream','Soaring','Standing|Stand','Star|Star','Twisted','Urgent','Utopian','Valiant');
|
||||
var nouns = Array('Action','Alert','Beauty','Claw','Darkness','Dawn','Day','Desert','Envy','Fall','Fist','Flight','Fury','Guard','Hammer','Hand','Honor','Hope','Hurricane','Liberty','Light','Lightning','Magic','Morning','October','Power','Rain','Repose','Roar','Scream','Skull','Sky','Skies','Shield','Stand','Star','Storm','Streak','Strike','Sun','Thunder','Victory','Whisper','Wind','Wrath');
|
||||
var colors = Array('Black','Blue','Brown','Gray','Green','Indego','Orange','Purple','Rainbow','Red','Scarlet','Silver','Violet','White','Yellow');
|
||||
var actors = Array('Cobra','Condor','Dragon','Eagle','Guardian','Hawk','Hydra','Jackal','King','Knight','Lady','Lion','Scorpion','Spartan','Titan','Victor','Viking','Warrior');
|
||||
var mission_grammars = Array(
|
||||
{chance:30, grammar: 'adj1 + " " + noun1'},
|
||||
{chance:20, grammar: 'adj1 + " " + actor'},
|
||||
{chance:10, grammar: 'color + " " + noun1'},
|
||||
{chance:10, grammar: 'color + " " + actor'},
|
||||
{chance:10, grammar: 'actor +"\'s " + noun1'},
|
||||
{chance:10, grammar: 'noun1 + " of the " + noun2'},
|
||||
{chance:10, grammar: 'noun1 + " of the " + actor'},
|
||||
{chance:10, grammar: 'actor + " of the " + noun1'},
|
||||
{chance:10, grammar: 'noun1 + " of " + noun2'},
|
||||
{chance:10, grammar: 'noun1 + " of " + color + " " + noun2'},
|
||||
{chance:10, grammar: 'adj1 + " " + noun1 + " and " + adj2 + " " + noun2'},
|
||||
{chance:3, grammar: '"Attack of the " + actor + "s"'},
|
||||
{chance:3, grammar: '"Return of the " + actor + "s"'}
|
||||
{chance:30, grammar: "{adj1} {noun1}"},
|
||||
{chance:20, grammar: "{adj1} {actor}"},
|
||||
{chance:10, grammar: "{color} {noun1}"},
|
||||
{chance:10, grammar: "{color} {actor}"},
|
||||
{chance:10, grammar: "{actor}'s {noun1}"},
|
||||
{chance:10, grammar: "{noun1} of the {noun2}"},
|
||||
{chance:10, grammar: "{noun1} of the {actor}"},
|
||||
{chance:10, grammar: "{actor} of the {noun1}"},
|
||||
{chance:10, grammar: "{noun1} of {noun2}"},
|
||||
{chance:10, grammar: "{noun1} of {color} {noun2}"},
|
||||
{chance:10, grammar: "{adj1} {noun1} and {adj2} {noun2}"},
|
||||
{chance:3, grammar: "Attack of the {actor}s"},
|
||||
{chance:3, grammar: "Return of the {actor}s"}
|
||||
);
|
||||
this.getNoun = function(badNouns) {
|
||||
return _.chain(nouns)
|
||||
@@ -65,7 +65,13 @@ this.getMissionName = function() {
|
||||
rand -= g.chance;
|
||||
}
|
||||
else {
|
||||
mission += eval(g.grammar);
|
||||
mission += g.grammar
|
||||
.replace(/{adj1}/, adj1)
|
||||
.replace(/{adj2}/, adj2)
|
||||
.replace(/{noun1}/, noun1)
|
||||
.replace(/{noun2}/, noun2)
|
||||
.replace(/{color}/, color)
|
||||
.replace(/{actor}/, actor);
|
||||
return mission;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user