 
 url = require('url')
 querystring = require('querystring')
+util = require('util')
 
 
 class JenkinsNotifier

    @robot = robot
    @failing = []

  error: (e) ->
    console.log "jenkins-notify error: #{error}. Data: #{req.body}"
    console.log error.stack

  shouldNotify: (notstrat, data) ->
    if data.build.status == 'FAILURE'

        @failing.splice index, 1 if index isnt -1

module.exports = (robot) ->
  robot.jenkins_notifier = new JenkinsNotifier robot

  robot.router.post "/hubot/jenkins-notify", (req, res) ->
    robot.jenkins_notifier.process req, res

