Skip to content

Instantly share code, notes, and snippets.

@jbt
Last active August 29, 2015 13:56
Show Gist options
  • Save jbt/9000375 to your computer and use it in GitHub Desktop.
Save jbt/9000375 to your computer and use it in GitHub Desktop.
Desk.com hubot script
# hubot script for desk
module.exports = (robot) ->
robot.router.post "/hook/desk", (req, res) ->
body = req.body.data
lines = body.split "\n"
data = {}
lines.forEach (line) ->
bits = line.split ":"
data[bits.shift()] = bits.join ":"
robot.messageRoom '#support', "New Support Request from #{data.from}: #{data.subject} <#{data.url}|View in Desk>"
res.send 'ok'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment