coffeescript - calling 2 https requests simultaneously in hubot coffescript -
module.exports = (robot) -> robot.respond /log (.*)/i, (msg) -> group = "test" incident_message = msg.match[0] service_key = keys[group] curtime = new date().gettime() incident_key = "hubot/#{curtime}" reporter = msg.message.user.name query = { "service_key": service_key, "incident_key": incident_key, "event_type": "trigger", "description": "change log #{reporter}", "details": "#{incident_message}" } string_query = json.stringify(query) content_length = string_query.length msg .http("https://events.pagerduty.com/generic/2010-04-15/create_event.json") .headers "content-type": "application/json", "content-length": content_length .post(string_query) (err, res, body) -> result = json.parse(body) if result.status == "su...