Skip to content

Instantly share code, notes, and snippets.

@jpadilla
Created September 12, 2012 21:02
Show Gist options
  • Save jpadilla/3709906 to your computer and use it in GitHub Desktop.
Save jpadilla/3709906 to your computer and use it in GitHub Desktop.
Hubot Github Status command
# Description
# A command to check the status of the web and git operations for github.com
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot github status - Returns status of Git, Pages, and Downloads
#
# Notes:
#
#
# Author:
# jpadilla
module.exports = (robot) ->
robot.respond /(github)( status)?/i, (msg) ->
msg.http('https://status.github.com/realtime.json')
.get() (err, res, body) ->
data = JSON.parse(body)
if data.git and data.pages and data.downloads
msg.send 'Battle station fully operational'
else
if data.git
git = 'up'
else
git = 'down'
if data.pages
pages = 'up'
else
pages = 'down'
if data.downloads
downloads = 'up'
else
downloads = 'down'
msg.send "Git is #{git}.\n" +
"Pages is #{pages}.\n" +
"Downloads is #{downloads}.\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment