Skip to content

Instantly share code, notes, and snippets.

@dbjpanda
Created March 22, 2020 10:00
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 dbjpanda/a1092b82f08776fa6ab12c850ca79021 to your computer and use it in GitHub Desktop.
Save dbjpanda/a1092b82f08776fa6ab12c850ca79021 to your computer and use it in GitHub Desktop.
function domainLookup(domain) {
var result = "";
if (domain == "") {
return;
}
// Function to lookup available domains using rdap
httpResult = UrlFetchApp.fetch("https://rdap.verisign.com/com/v1/domain/"+domain,{muteHttpExceptions: true});
if (httpResult.getResponseCode() == 404) {
return "Available";
}
else{
return "Not Available"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment