Skip to content

Instantly share code, notes, and snippets.

@3100
Last active August 29, 2015 13:59
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 3100/10625883 to your computer and use it in GitHub Desktop.
Save 3100/10625883 to your computer and use it in GitHub Desktop.
a hubot script which proxies our inner service
module.exports = (robot) ->
robot.respond /yukkuri (\S+)/i, (msg) ->
url = "http://xxxx.t.proxylocal.com/#{encodeURIComponent(msg.match[1])}"
getResult(msg, url)
getResult = (msg, url) ->
msg.http(url).get() (err, res, body) ->
if err
msg.send "something went wrong."
else
msg.send "done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment