Skip to content

Instantly share code, notes, and snippets.

@connor
Created May 28, 2012 05:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connor/2817530 to your computer and use it in GitHub Desktop.
Save connor/2817530 to your computer and use it in GitHub Desktop.
info method implementation
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