A nodejs Jabbr client
npm install njabbr
var JabbrClient = require('njabbr').JabbrClient;
var client = new JabbrClient("http://jabbr-staging.apphb.com/");
client.on('messageReceived', function(msg, room) {
console.log("[" + msg.When + "] " + msg.User.Name + ": " + msg.Content);
});
client.connect("username", "password", function(task) {
console.log("You are now logged in");
client.joinRoom("SomeTestRoom", function() {
console.log("You have joined SomeTestRoom");
// speak robot speak!
client.say("Hey everyone!", "SomeTestRoom");
client.getRoomInfo("SomeTestRoom", function(roomInfo) {
console.log("Users");
for (var key in roomInfo.Users) {
var user = roomInfo.Users[key];
console.log(user.Name);
}
});
});
// logoff after 10 seconds
setTimeout(function() {
client.disconnect();
}, 10000);
});