Ver Mensaje Individual
  #13 (permalink)  
Antiguo 06/06/2003, 01:25
Avatar de Helbira
Helbira
 
Fecha de Ingreso: octubre-2001
Ubicación: Sevilla, España
Mensajes: 1.228
Antigüedad: 23 años, 6 meses
Puntos: 5
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%
Sub obtenerInformacion(Url)
dim HTTP
set HTTP=Server.CreateObject("Microsoft.XMLHTTP")
HTTP.open "GET", Url , False
HTTP.setRequestHeader "Accept-Language", "sp"
HTTP.setRequestHeader "Pragma", "no-cache"
HTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

HTTP.Send
stu=HTTP.statusText
if HTTP.statusText="OK" then
body8209 = HTTP.responseBody
sOut = ""
For i = 0 to UBound(body8209)
sOut = sOut & chrw(ascw(chr(ascb(midb(body8209,i+1,1)))))
Next
strFileContents=sOut
else
Response.write "Error obteniendo Página " & HTTP.statustext
end if
set HTTP = nothing

Dim key1, key2, errorkey, errordes
strFileContents = replace(strFileContents, "<meta name=keywords", "<meta name=""keywords""")
strFileContents = replace(strFileContents, "<meta NAME=keywords", "<meta name=""keywords""")
strFileContents = replace(strFileContents, "<META NAME=keywords", "<meta name=""keywords""")
strFileContents = replace(strFileContents, "<META NAME=KEYWORDS", "<meta name=""keywords""")
'...... etc. Resto de combinaciones de mayus y minus)

strFileContents = replace(strFileContents, "<meta name=description", "<meta name=""description""")
strFileContents = replace(strFileContents, "<meta NAME=description", "<meta name=""description""")
strFileContents = replace(strFileContents, "<META NAME=description", "<meta name=""description""")
strFileContents = replace(strFileContents, "<META NAME=DESCRIPTION", "<meta name=""description""")
'... etc. Resto de combinaciones

strFileContents = replace(strFileContents, "<meta name=language", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME=language", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME=language", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME=LANGUAGE", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name=language", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name=LANGUAGE", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME=LANGUAGE", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta name='language'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME='language'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME='language'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME='LANGUAGE'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name='language'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name='LANGUAGE'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME='LANGUAGE'", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta name=""language""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME=""language""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME=""language""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META NAME=""LANGUAGE""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name=""language""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<META name=""LANGUAGE""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<meta NAME=""LANGUAGE""", "<meta name=""language""")
strFileContents = replace(strFileContents, "<TITLE>", "<title>")
strFileContents = replace(strFileContents, "</TITLE>", "</title>")
strFileContents = replace(strFileContents, "<A", "<a")
strFileContents = replace(strFileContents, "</A>", "</a>")
if InStr(1, strFileContents, "<meta name=""keywords""",1) > 0 then
key1 = InStr(1, strFileContents, "<meta name=""keywords""", 1)
key1 = key1 + Len("<meta name=""keywords""")
key2 = InStr(key1, strFileContents, """>", 1)
keywords = Trim(Mid(strFileContents, key1, (key2 - key1)))
keywords = Replace (keywords, "Content=""", "")
keywords = Replace (keywords, "content=""", "")
keywords = Replace (keywords, "CONTENT=""", "")
keywords = Replace (keywords, "content=", "")
keywords = Replace (keywords, "CONTENT=", "")
keywords = Replace (keywords, "content='", "")
keywords = Replace (keywords, "CONTENT='", "")
end if

Dim desc1, desc2
if InStr(1, strFileContents, "<meta name=""description""",1) > 0 then
desc1 = InStr(1, strFileContents, "<meta name=""description""", 1)
desc1 = desc1 + Len("<meta name=""description""")
desc2 = InStr(desc1, strFileContents, """>", 1)
descripcion = Trim(Mid(strFileContents, desc1, (desc2 - desc1)))
descripcion = Replace (descripcion , "Content=""", "")
descripcion = Replace (descripcion , "content=""", "")
descripcion = Replace (descripcion , "CONTENT=""", "")
descripcion = Replace (descripcion , "content=", "")
descripcion = Replace (descripcion , "CONTENT=", "")
descripcion = Replace (descripcion , "content='", "")
descripcion = Replace (descripcion , "CONTENT='", "")
end if
if InStr(1, strFileContents, "<meta name=""language""",1) > 0 then
lang1 = InStr(1, strFileContents, "<meta name=""language""", 1)
lang1 = lang1 + Len("<meta name=""language""")
lang2 = InStr(lang1, strFileContents, """>", 1)
language = Trim(Mid(strFileContents, lang1, (lang2 - lang1)))
language = Replace (language , "Content=""", "")
language = Replace (language , "content=""", "")
language = Replace (language , "CONTENT=""", "")
language = Replace (language , "content=", "")
language = Replace (language , "CONTENT=", "")
language = Replace (language , "content='", "")
language = Replace (language , "CONTENT='", "")
end if
if InStr(1, strFileContents, "<title>",1) > 0 then
tit1 = InStr(1, strFileContents, "<title>", 1)
tit1 = tit1 + Len("<title>")
tit2 = InStr(tit1, strFileContents, "</title>", 1)
titulo = Trim(Mid(strFileContents, tit1, (tit2 - tit1)))
titulo = Replace (titulo, "'", " ")
end if
response.Write("<strong>pagina Indexable</strong><br><br>")
response.Write("<strong>"&stu&"</strong><br><br>")
response.write("KEYWORDS:<br> ")
response.write("-----------------------<br>")
response.Write(keywords)
response.Write("<br><br>")
response.write("DESCRIPCIÓN:<br> ")
response.write("-----------------------<br>")
response.Write(descripcion)
response.Write("<br><br>")
response.write("TITLE:<br> ")
response.write("-----------------------<br>")
response.Write(titulo)
response.Write("<br><br>")
response.write("Idioma:<br> ")
response.write("-----------------------<br>")
response.Write(language)
END Sub
%>
</head>
<body bgcolor="#FFFFFF">
<%
obtenerInformacion("http://www.sevillaglobal.es")
%>
</body>
</html>

Este código me funciona perfectamente con lo acentos y las eñes. Aunque la versión que han puesto por aquí es más eficiente. Pero creo que no le han agregado lo de los acentos.

Un beso

P.D.: No está completo porque no me cabía en el mensaje. Te lo mandé también por email