Skip to content

Commit

Permalink
Missed some quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristandunn committed Jun 10, 2011
1 parent 7e13c49 commit 8c67d1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions examples/growl.js
@@ -1,36 +1,36 @@
var system = require('sys');
var Campfire = require('../lib/campfire').Campfire;
var system = require("sys");
var Campfire = require("../lib/campfire").Campfire;

var instance = new Campfire({
ssl : false,
token : 'YOUR_TOKEN',
account : 'YOUR_ACCOUNT'
token : "YOUR_TOKEN",
account : "YOUR_ACCOUNT"
});

instance.join(ROOM_ID, function(error, room) {
room.listen(function(message) {
// Ignore emotes, sounds, timestamps, etc.
if (message.type != 'TextMessage') {
if (message.type != "TextMessage") {
return;
}

// Ignore your own messages.
// if (message.user.name == 'YOUR_NAME') {
// if (message.user.name == "YOUR_NAME") {
// return;
// }

// Only notify on keywords.
// var keywords = ['YOUR_NAME', 'URGENT', 'Whatever'];
// var keywords = ["YOUR_NAME", "URGENT", "Whatever"];
//
// if (!message.body.match(new RegExp(keywords.join('|')))) {
// if (!message.body.match(new RegExp(keywords.join("|")))) {
// return;
// }

var
command = '/usr/local/bin/growlnotify';
command += ' -t "' + message.user.name + '"';
command += ' -m "' + message.body.replace('"', "'") + '"';
command += ' --image "examples/images/icon.png"';
command = "/usr/local/bin/growlnotify";
command += " -t '" + message.user.name + "'";
command += " -m '" + message.body.replace("'", "'") + "'";
command += " --image 'examples/images/icon.png'";

system.exec(command);
});
Expand Down
16 changes: 8 additions & 8 deletions examples/ping.js
@@ -1,21 +1,21 @@
var Campfire = require('../lib/campfire').Campfire;
var Campfire = require("../lib/campfire").Campfire;

var instance = new Campfire({
ssl : false,
token : 'YOUR_TOKEN',
account : 'YOUR_ACCOUNT'
token : "YOUR_TOKEN",
account : "YOUR_ACCOUNT"
});

instance.join(ROOM_ID, function(error, room) {
room.listen(function(message) {
if (message.body == 'PING') {
console.log('PING received.');
if (message.body == "PING") {
console.log("PING received.");

room.speak('PONG', function(error, response) {
console.log('PONG sent at ' + response.message.created_at + '.');
room.speak("PONG", function(error, response) {
console.log("PONG sent at " + response.message.created_at + ".");
});
} else {
console.log('Received unknown message:');
console.log("Received unknown message:");
console.log(message);
}
});
Expand Down

0 comments on commit 8c67d1a

Please sign in to comment.