Skip to content

Instantly share code, notes, and snippets.

@francois2metz
Created April 23, 2012 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save francois2metz/2470292 to your computer and use it in GitHub Desktop.
Save francois2metz/2470292 to your computer and use it in GitHub Desktop.
A simple hubot script @parisjs special node
# This is a simple hubot script
#
module.exports = (robot) ->
robot.respond /do you love javascript\?/i, (msg) ->
msg.send "Yes! But I prefer coffee-script."
msg.finish()
robot.hear /javascript/i, (msg) ->
msg.send "Do you want to say: #{msg.message.text.replace(/javascript/g, 'coffee-script')}"
robot.hear /is google down\?/i, (msg) ->
msg.http('http://www.google.fr/').get() (err, res, body) ->
msg.send "never, it's you." if res.statusCode == 200
msg.send "maybe, but you should check the connection." if res.statusCode != 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment