Skip to content

Instantly share code, notes, and snippets.

@weppos
Created June 7, 2012 18:38
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 weppos/2890668 to your computer and use it in GitHub Desktop.
Save weppos/2890668 to your computer and use it in GitHub Desktop.
RoboWhois + ASP example: get the WHOIS record for a domain.
<%
' Requests the WHOIS record for the domain
' and returns a String containing the WHOIS response.
Function Whois(url)
Dim objXmlHttp
Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
objXmlHttp.Open "GET", url, False, "YOUR_API_KEY", "X"
objXmlHttp.SetRequestHeader "User-Agent", "ASP/3.0"
objXmlHttp.Send
If objXmlHttp.Status = 200 Then
Whois = 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 = Whois("http://api.robowhois.com/whois/google.com")
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment