Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (26 sloc) 0.774 kB
# Description:
# Find the build status of an open-source project on Travis
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot travis me <user>/<repo> - Returns the build status of https://github.com/<user>/<repo>
#
# Author:
# sferik
module.exports = (robot) ->
robot.respond /travis me (.*)/i, (msg) ->
project = escape(msg.match[1])
msg.http("http://travis-ci.org/#{project}.json")
.get() (err, res, body) ->
response = JSON.parse(body)
if response.last_build_status == 0
msg.send "Build status for #{project}: Passing"
else if response.last_build_status == 1
msg.send "Build status for #{project}: Failing"
else
msg.send "Build status for #{project}: Unknown"
Jump to Line
Something went wrong with that request. Please try again.