Created
June 5, 2012 15:53
-
-
Save michaeltwofish/2875890 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var req = https.request( options, function( res ) { | |
var data = ''; | |
res.on('data', function( chunk ) { | |
data += chunk; | |
}); | |
res.on('end', function() { | |
try { | |
var parsed_data = JSON.parse( data ); | |
if ( parsed_data.fields ) { | |
msg.say( issue + " Status: " + parsed_data.fields.status.value.name ); | |
msg.say( "Summary: " + parsed_data.fields.summary.value ); | |
msg.say( "Issue URL: " + issue_url + " API URL: " + parsed_data.self ); | |
} | |
else if ( parsed_data.errorMessages ) { | |
msg.say( parsed_data.errorMessages[0] ); | |
} | |
} catch (e) { | |
msg.say( "Could not parse response. You might try " + issue_url ); | |
return; | |
} | |
}); | |
}); | |
req.end(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment