public
Last active

  • Download Gist
fortune.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11
# Receive a fortune
#
# fortune me - Returns a random fortune
HTTP = require "http"
 
module.exports = (robot) ->
robot.hear /fortune( me)?/i, (response) ->
opt = { method: "GET", host: "fortunes.herokuapp.com", path: "/random" }
req = HTTP.request opt, (res) ->
response.send res.body["fortune"]
req.end()

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.