Skip to content
Browse files

Merge pull request #3 from sferik/travis-me

Travis me!
  • Loading branch information...
2 parents 33f8c68 + 0150a91 commit df62ebace3e1383a7ab0ada53c77275611af9f96 @holman holman committed Oct 25, 2011
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/scripts/travis.coffee
View
17 src/scripts/travis.coffee
@@ -0,0 +1,17 @@
+# Find the build status of an open-source project on Travis
+#
+# hubot <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"

0 comments on commit df62eba

Please sign in to comment.
Something went wrong with that request. Please try again.