Created
April 15, 2012 18:23
-
-
Save weppos/2394239 to your computer and use it in GitHub Desktop.
RoboWhois + ASP example: get the parsed WHOIS record for a domain.
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
<% | |
' Requests the parsed WHOIS record for the domain | |
' and returns a String containing the JSON-encoded parsed WHOIS properties. | |
Function WhoisProperties(url) | |
Dim objXmlHttp | |
Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP") | |
objXmlHttp.Open "GET", url, False, "YOUR_API_KEY", "X" | |
objXmlHttp.SetRequestHeader "Content-Type", "application/json" | |
objXmlHttp.SetRequestHeader "User-Agent", "ASP/3.0" | |
objXmlHttp.Send | |
If objXmlHttp.Status = 200 Then | |
WhoisProperties = CStr(objXmlHttp.ResponseText) | |
end if | |
Set objXmlHttp = Nothing | |
End Function | |
' Declare the variable to store the result | |
Dim strResult | |
' Call the function and assign the result | |
strResult = WhoisProperties("http://api.robowhois.com/whois/google.com/properties") | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment