Skip to content

Instantly share code, notes, and snippets.

@weppos
Created June 7, 2012 18:38
Show Gist options
  • Save weppos/2890668 to your computer and use it in GitHub Desktop.
Save weppos/2890668 to your computer and use it in GitHub Desktop.

Revisions

  1. weppos revised this gist Jun 7, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions whois.asp
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    ' Requests the WHOIS record for the domain
    ' and returns a String containing the WHOIS response.
    Function WhoisProperties(url)
    Function Whois(url)
    Dim objXmlHttp
    Set objXmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
    @@ -12,7 +12,7 @@ Function WhoisProperties(url)
    objXmlHttp.Send
    If objXmlHttp.Status = 200 Then
    WhoisProperties = CStr(objXmlHttp.ResponseText)
    Whois = CStr(objXmlHttp.ResponseText)
    end if
    Set objXmlHttp = Nothing
    @@ -22,7 +22,7 @@ End Function
    ' Declare the variable to store the result
    Dim strResult
    ' Call
    strResult = WhoisProperties("http://api.robowhois.com/whois/google.com")
    ' Call the function and assign the result
    strResult = Whois("http://api.robowhois.com/whois/google.com")
    %>
  2. weppos created this gist Jun 7, 2012.
    28 changes: 28 additions & 0 deletions whois.asp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    <%
    ' Requests the WHOIS record for the domain
    ' and returns a String containing the WHOIS response.
    Function WhoisProperties(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
    WhoisProperties = CStr(objXmlHttp.ResponseText)
    end if
    Set objXmlHttp = Nothing
    End Function
    ' Declare the variable to store the result
    Dim strResult
    ' Call
    strResult = WhoisProperties("http://api.robowhois.com/whois/google.com")
    %>