-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ae33d6
commit 0c8a9a0
Showing
32 changed files
with
957 additions
and
711 deletions.
There are no files selected for viewing
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,50 @@ | ||
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js"></script> | ||
<script type="text/javascript"> | ||
var domain = "google.com"; | ||
var key = "Your domain availability api apiKey"; | ||
var secret = "Your domain availability api secretKey"; | ||
var username = "Your domain availability api username"; | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Domain Availability API jQuery Api Key Search Sample</title> | ||
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js"></script> | ||
<script type="text/javascript"> | ||
|
||
$(function () { | ||
var time = (new Date()).getTime(); | ||
var req = btoa(unescape( | ||
encodeURIComponent(JSON.stringify({t:time,u:username})))); | ||
var digest = CryptoJS.HmacMD5( | ||
username+time+key,secret).toString(CryptoJS.enc.Hex); | ||
$.ajax({ | ||
url: "http://www.whoisxmlapi.com/whoisserver/WhoisService", | ||
dataType: "json", | ||
data: {cmd: "GET_DN_AVAILABILITY", requestObject: req, digest: digest, | ||
domainName: domain, outputFormat: "JSON"}, | ||
complete: function(data) { | ||
$("body").append("<pre>" + data.responseText+"</pre>"); | ||
} | ||
var apiUrl = "https://www.whoisxmlapi.com/whoisserver/WhoisService"; | ||
var domain = "google.com"; | ||
var username = "Your domain availability api username"; | ||
var key = "Your domain availability api key"; | ||
var secret = "Your domain availability api secret key"; | ||
|
||
$(function() { | ||
var time = (new Date()).getTime(); | ||
|
||
var params = { | ||
t: time, | ||
u: username | ||
}; | ||
|
||
var data = JSON.stringify(params); | ||
var req = btoa(unescape(encodeURIComponent(data))); | ||
var digest = CryptoJS.HmacMD5(username + time + key, secret) | ||
.toString(CryptoJS.enc.Hex); | ||
|
||
$.ajax( | ||
{ | ||
url: apiUrl, | ||
dataType: "json", | ||
data: { | ||
cmd: "GET_DN_AVAILABILITY", | ||
requestObject: req, | ||
digest: digest, | ||
domainName: domain, | ||
outputFormat: "JSON" | ||
}, | ||
complete: function(data) { | ||
$("body").append( | ||
"<pre>" + JSON.stringify(data, null, 2)+"</pre>"); | ||
} | ||
} | ||
); | ||
}); | ||
}); | ||
</script> | ||
|
||
</script> | ||
</head> | ||
<body></body> | ||
</html> |
Oops, something went wrong.