Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 34 lines (30 sloc) 0.901 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
# Description:
# This is script is a copy of the Scout WebHook hubot script Tweaked
# for My App Status (http://myappstat.us)
#
# Dependencies:
# None
#
# Configuration:
# setup http://hostname/hubot/myappstatus/ROOMNUMBER as
# your notification webook. If on Heroku lookup the hostname where
# the hubot server is running. (e.g. my-hubot.herokuapp.com)
#
# Commands:
# None
#
# Author:
# bricooke

module.exports = (robot) ->
  robot.router.post '/hubot/myappstatus/:room', (req, res) ->
    room = req.params.room

    # Parameters from the post are:
    # name=MyGreatApp
    # version=1.0
    # state=waiting for review
    # link=https://myappstat.us/team/blah/app/1
    #
    robot.messageRoom room, "#{req.body.name} #{req.body.version} is now #{req.body.state}: #{req.body.link}"

    # Send back an empty response
    res.writeHead 204, { 'Content-Length': 0 }
    res.end()
Something went wrong with that request. Please try again.