Skip to content
Snippets Groups Projects
Commit 5b8d3c51 authored by rohieb's avatar rohieb
Browse files

irc: add weekday and time

parent e92de177
No related branches found
No related tags found
1 merge request!5irc: add weekday and time
......@@ -4,6 +4,11 @@ var CHANNEL = '#stratum0';
var PW = 'Fagee9ie'
function datestring (date) {
days = [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ]
return days[date.getDay()] + ', ' + date.getHours() + ':' + date.getMinutes()
}
module.exports = function (io) {
var client = new irc.Client('bouncer.ksal.de', 'infodisplay', {
channels: [CHANNEL],
......@@ -17,7 +22,8 @@ module.exports = function (io) {
client.addListener('message', function (from, to, message) {
if (to != CHANNEL || from === undefined) {return;}
message = message.replace(/</g,'&lt;').replace(/>/g,'&gt;');
content.push('<p><span>'+from+'</span> '+message+'</p>');
date = datestring(new Date());
content.push('<p><irc-date>'+date+'</irc-date> <span>'+from+'</span> '+message+'</p>');
if (content.length > 25) {
content.shift();
}
......
......@@ -47,6 +47,17 @@ h3 {
content: ">";
color: #839496;
}
irc-date {
color: #2aa198;
}
irc-date::before {
content: "[";
color: #839496;
}
irc-date::after {
content: "]";
color: #839496;
}
#weather {
font-size: 120%;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment