Whois con ASP

Muchos me han preguntado como se puede hacer un Whois para sus paginas, he aqui uno, que utiliza datos de internic y de Nic Mexico.



Este whois sirve para checar la disponibilidad de los dominios.
'Poner tiempo de espera a 90min
Server.ScriptTimeout = 90

'Whois function to query the whois server
Private Function whoisResult(whoisURL, strMethod, strResultsStart, strResultsEnd)

 'Dimension variables
Dim objXMLHTTP
 Dim strWhoisResultString

 Set objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")

  objXMLHTTP.Open strMethod, whoisURL, False
 
  objXMLHTTP.Send

  strWhoisResultString = objXMLHTTP.ResponseText

  If Len(strDomainName) < whoisresult = "No Valido - debe tener por lo menos 3 caracteres" whoisresult = "A ocurrido un error" whoisresult =" resultFormater(strWhoisResultString," objxmlhttp =" Nothing" lngresultsstartpos =" InStr(1," lngresultsendpos =" InStr(lngResultsStartPos," lngresultsstartpos ="<" lngresultsendpos =" lngResultsStartPos" resultformater =" Trim(Mid(strWhoisResultString," intloopcounter =" 0" strtextinput =" Replace(strTextInput," intloopcounter =" 46" strtextinput =" Replace(strTextInput," intloopcounter =" 58" strtextinput =" Replace(strTextInput," intloopcounter =" 123" strtextinput =" Replace(strTextInput," characterstrip =" strTextInput"> "" Then

 strDomainName = LCase(strDomainName)

 strDomainName = Replace(strDomainName, "http://", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, "www.", "", 1, -1, 1)

 strDomainName = Replace(strDomainName, ".com", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".net", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".org", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".info", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".biz", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".tv", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".name", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".co.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".org.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".ltd.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".plc.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".net.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".me.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".pn.uk", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".com.mx", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".net.mx", "", 1, -1, 1)
 strDomainName = Replace(strDomainName, ".org.mx", "", 1, -1, 1)

 If Left(strDomainName, 1) = "-" Then strDomainName = Mid(strDomainName, 2, Len(strDomainName))
 If Right(strDomainName, 1) = "-" Then strDomainName = Mid(strDomainName, 1, Len(strDomainName)-1)

 strDomainName = Replace(strDomainName, "--", "-", 1, -1, 1)

 strDomainName = characterStrip(strDomainName)
End If

If strDomainName <> "" Then
 Response.Write("
")

Response.Write("Resultados de la busqueda de
www." & strDomainName & strSuffix & "

")
     
 If strSuffix = ".com" Then
 Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".com&type=domain", "GET", "
", "
")) ElseIf strSuffix = ".net" Then Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".net&type=domain", "GET", "
", "
")) ElseIf strSuffix = ".org" Then Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".org&type=domain", "GET", "
", "
")) ElseIf strSuffix = ".biz" Then Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".biz&type=domain", "GET", "
", "
")) ElseIf strSuffix = ".info" Then Response.Write(whoisResult("http://www-whois.internic.net/cgi/whois?whois_nic=" & strDomainName & ".info&type=domain", "GET", "
", "
")) ElseIf strSuffix = ".com.mx" Then Response.Write(whoisResult("http://www.sitiosweb.com.mx/whois/example.php?domain=" & strDomainName & strSuffix & "&domain_type=1&template_type=&object_type_1=&object_type_2=&object_type_3=3&text=" & strDomainName & "&current_page=Busqueda.Who_Is_2", "GET", "Este dominio esta disponible")) ElseIf strSuffix = ".net.mx" Then Response.Write(whoisResult("http://www.sitiosweb.com.mx/whois/example.php?domain=" & strDomainName & strSuffix & "&domain_type=3&template_type=&object_type_1=&object_type_2=&object_type_3=3&text=" & strDomainName & "&current_page=Busqueda.Who_Is_2", "GET", "Este dominio esta disponible")) ElseIf strSuffix = ".org.mx" Then Response.Write(whoisResult("http://www.sitiosweb.com.mx/whois/example.php?domain=" & strDomainName & strSuffix & "&domain_type=5&template_type=&object_type_1=&object_type_2=&object_type_3=3&text=" & strDomainName & "&current_page=Busqueda.Who_Is_2", "GET", "Este dominio esta disponible")) End If Response.Write("
") End If


Espero les sirva

0 comentarios: