Created On: 11/24/2004 10:00:00 AM <html> <head> <title>META-NAME PARSER</title> </head> <body> <h1>META-NAME PARSER</h1> <form method="POST" action="meta-name-parser.asp"> <p><input type="text" name="url" size="45"><input type="submit" value="PARSE" name="func"></p> </form> <% if request.form("func") = "PARSE" then Set objCon = Server.CreateObject ("Microsoft.XMLHTTP") objCon.Open "GET", request.form("url"), False, "", "" objCon.Send strPage = objCon.ResponseText Set objRegExp = New RegExp objRegExp.IgnoreCase = True objRegExp.Pattern = "<TITLE>([^<]*)</TITLE>" Set objMatch = objRegExp.Execute(strPage) if objMatch.Count = 0 Then response.write "Title Not Found .. " else strTitle = objMatch.item(0).Value strTitle = Replace(strTitle, "<TITLE>", "", 1, -1, vbTextCompare) strTitle = Replace(strTitle, "</TITLE>", "", 1, -1, vbTextCompare) response.write strTitle & "<br><br>" end if objRegExp.Pattern = "<META[^>]+(name=""description""|content=""([^""]*)"")[^>]+(name=""description""|content=""([^""]*)"")[^>]*>" Set objMatch = objRegExp.Execute(strPage) if objMatch.Count = 0 Then response.write "Description Not Found .. " & "<br><br>" else strDesc = objMatch.item(0).Value strDesc = Mid(strDesc, InStr(1, strDesc, "content=""", vbTextCompare) + 9) strDesc = Mid(strDesc, 1, InStr(1, strDesc, """", vbTextCompare) -1) response.write strDesc & "<br><br>" end if objRegExp.Pattern = "<META[^>]+(name=""keywords""|content=""([^""]*)"")[^>]+(name=""keywords""|content=""([^""]*)"")[^>]*>" Set objMatch = objRegExp.Execute(strPage) if objMatch.Count = 0 Then response.write "Keywords Not Found .. " else strKeywords = objMatch.item(0).Value strKeywords = Mid(strKeywords, InStr(1, strKeywords, "content=""", vbTextCompare) + 9) strKeywords = Mid(strKeywords, 1, InStr(1, strKeywords, """", vbTextCompare) -1) response.write strKeywords & "<br><br>" end if end if %> </body> </html>
|