diff --git a/scripts/travis.coffee b/scripts/travis.coffee new file mode 100644 index 0000000..7586e1f --- /dev/null +++ b/scripts/travis.coffee @@ -0,0 +1,17 @@ +# Find the build status of an open-source project on Travis +# +# sferik/rails_admin - Returns the build status of https://github.com/sferik/rails_admin +# + +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"