Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 17 lines (16 sloc) 0.673 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# Find the build status of an open-source project on Travis
#
# <travis me> 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"
Something went wrong with that request. Please try again.