Permalink
Browse files

more debugging

  • Loading branch information...
1 parent d3adab4 commit e7c5339d9f32280be1519f55941ab459a21d0241 @ryanmoran ryanmoran committed Mar 29, 2013
Showing with 2 additions and 4 deletions.
  1. +1 −3 newrelic.coffee
  2. +1 −1 xkcd.coffee
View
4 newrelic.coffee
@@ -31,14 +31,12 @@ module.exports = (robot) ->
msg.http("https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}/threshold_values.xml?api_key=#{apiKey}")
.get() (err, res, body) ->
+ msg.send body
if err
msg.send "New Relic says: #{err}"
return
- robot.logger.info body
(new Parser).parseString body, (err, json) ->
- robot.logger.info err if err
- robot.logger.info json if json
threshold_values = json['threshold-values']['threshold_value'] || []
lines = threshold_values.map (threshold_value) ->
"#{threshold_value['$']['name']}: #{threshold_value['$']['formatted_metric_value']}"
View
2 xkcd.coffee
@@ -43,7 +43,7 @@ module.exports = (robot) ->
if res.statusCode == 404
max = 0
else
- max = JSON.parse(body).num
+ max = JSON.parse(body).num
num = Math.floor((Math.random()*max)+1)
msg.http("http://xkcd.com/#{num}/info.0.json")
.get() (err, res, body) ->

0 comments on commit e7c5339

Please sign in to comment.