Created
July 21, 2010 01:28
-
-
Save hackervera/483895 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
var net = require('net'); | |
var sys = require('sys'); | |
var fs = require('fs'); | |
var irc = require('./node-irc/lib/irc'); | |
var re = new RegExp('^!talk (.*)'); | |
var redis = require('./redis-node-client/lib/redis-client').createClient(); | |
var dgram = require('dgram'); | |
var match; | |
fs.readFile('./irc.config', function (err, data) { | |
if (err) throw err; | |
//console.log(Object.getOwnPropertyNames(Array.prototype)); | |
//eval(data.toString()); | |
//console.log(data.toString()); | |
if (typeof data.toString == 'string') | |
{ | |
console.log(data); | |
//eval(data); | |
} | |
}); | |
udp = dgram.createSocket('udp4'); | |
udp.on('message', function(message,rinfo) | |
{ | |
client.say('#geoloqi', message + "from udp"); | |
}); | |
udp.on('error', function(message) | |
{ | |
console.log(message); | |
}); | |
udp.bind(2222); | |
redis.subscribeTo("geojs", function(channel, message, pattern) | |
{ | |
client.say('#geoloqi', message); | |
}); | |
var client = new irc.Client('irc.freenode.net','GeoJS', | |
{ | |
channels: ['#geoloqi'], | |
}); | |
/* | |
client.addListener('message#geoloqi', function (from, message) { | |
if(match = re.exec(message)) | |
{ | |
client.say('#geoloqi', match[1]); | |
sys.puts(from + ' => #geoloqi: ' + message); | |
} | |
}); | |
socket = net.createConnection(31337,host="nostat.us"); | |
socket.on("connect", function() | |
{ | |
var foo = "bar"; | |
console.log("foo"); | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment