Created
April 11, 2011 20:51
-
-
Save adamtaylor/914312 to your computer and use it in GitHub Desktop.
node.js newbism
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 jerk = require( 'jerk' ), | |
sys = require( 'sys' ), | |
sqlite = require( 'sqlite' ); | |
var options = { | |
server: 'irc.freenode.net', | |
nick: 'Laurabelle', | |
channels: [ '#kkkk', ] | |
} | |
jerk( function( j ) { | |
//var db = new sqlite.Database(); | |
j.watch_for( 'soup', function( message ) { | |
message.say( message.user + ': soup is good food!' ) | |
}) | |
j.watch_for( /^(.+) is (.*)/, function( message ) { | |
message.say( 'Okay, ' + message.user + ': ' + message.match_data[1] + ' is ' + message.match_data[2] ) | |
}) | |
//db.open("info.db", function (error) { | |
//if (error) { | |
//throw error; | |
//} | |
//db.execute( | |
//"INSERT INTO factoids (thing,fact) VALUES (?,?)", | |
//[message.match_data[1], message.match_data[2]], | |
//function (error, rows) { | |
//if (error) throw error; | |
//} | |
//); | |
//}); | |
}).connect( options ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment