Created
May 28, 2012 05:57
-
-
Save connor/2817530 to your computer and use it in GitHub Desktop.
info method implementation
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
exports.info = function(query, callback) { | |
request("http://domai.nr/api/json/info?q=" + query, function(err, response, body) { | |
if (response.statusCode === 200) { | |
callback( JSON.parse(body) ) | |
} else { | |
throw new Error("Sorry, there was an error. Make sure " + query + " is a valid domain to look up. Here's the response I got:\n" + JSON.stringify(response) ) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment