<%@ Language = VBScript %> <% Option Explicit %> <% Response.Buffer = true %> <% Dim query, xml, Node, resultLength, iCount, moreResults, txtOffset Dim nRes, FSOnly, queryStr, Cat, fs txtOffset = Request("offset") if txtOffset = "" Or Not IsNumeric(txtOffset) Then txtOffset = 0 if Request("nRes") <> "" And IsNumeric(Request("nRes")) Then nRes = Request("nres") Else nRes = 10 If Request("FSOnly") <> "" Then FSOnly = 1 If Request("Cat") <> "" Then Cat = Request("Cat") Else Cat = "main" End If query = Request("qry") queryStr = "?Ass=1000&qry=" & Server.URLEncode(query) & "&nFS=4&Details=1&hl=1" queryStr = queryStr & "&ip=" & Request.ServerVariables("REMOTE_ADDR") %> YourWebsite.co.uk

YourWebsite.co.uk


Search The UK Web
<% set fs=Server.CreateObject("Scripting.FileSystemObject") %>
Main Insurance Finance Shopping Travel None

<% If Query <> "" Then %>
<% For iCount= 0 to CInt(resultLength)-1 set Node = xml.responseXML.selectSingleNode("SEARCHRESULTS/RESULTSET/RESULT[@ID=" & CInt(iCount)& "]") %>
<% %><% %><% Next %>
<% query = Replace(query,""",""") Response.Write("Your search for " & query & " returned the following results:
") Set xml = Server.CreateObject ("Microsoft.XMLHTTP") xml.Open "GET", "http://www.mirago.co.uk/scripts/xml.asp"& queryStr & "&offset=" & txtOffset, false' xml.send resultLength = CInt(xml.responseXML.selectNodes("SEARCHRESULTS/RESULTSET/RESULT").length) %>
<% Response.Write("
") Response.Write("") Response.Write(Node.selectSingleNode("TITLE").text & "
") %>
<% Response.Write("
" & Node.selectSingleNode("ABSTRACT").text & "
") %>
<% '*** The two lines below strip off the HTTP:// and / at the beginning and end of the URL, if present. If Left(Node.selectSingleNode("URL").text,7) = "http://" Then Node.selectSingleNode("URL").text = Mid(Node.selectSingleNode("URL").text,8) If Right(Node.selectSingleNode("URL").text,1) = "/" Then Node.selectSingleNode("URL").text = Left(Node.selectSingleNode("URL").text,Len(Node.selectSingleNode("URL").text)-1) Response.Write("
" & Node.selectSingleNode("URL").text & "

") %>
<% if resultLength > 0 Then Set Node = xml.responseXML.selectSingleNode("SEARCHRESULTS/RESULTSET[@DATABASE=""Mirago""]") moreResults = Eval(Node.getAttribute("MORERESULTS")) End If Set xml = nothing moreResults = true If moreResults OR txtOffset > 0 Then Response.Write("

") If txtOffset > 0 Then Response.Write("<< Previous results     ") If moreResults AND (CInt(txtOffset) < CInt(200-nres)) AND Query <> "" AND iCount+1 >= nRes Then Response.Write("More results >>") Response.Write("

") End If Response.Write("
") %>
<% '*** If there is no Query, then the directories below are displayed. Else Dim wFile, aCategories(30), aCategory, cCount, catCount, nCat, colCount, sPath '*** Reads in the Categories from a file. Cat= Cat + ".txt" Set fs = CreateObject("Scripting.FileSystemObject") sPath = server.MapPath(Cat) If fs.FileExists(sPath) Then set wfile = fs.OpenTextFile(sPath) nCat = -1 Do While Not wfile.AtEndOfStream nCat = nCat + 1 aCategories(nCat) = wfile.ReadLine Loop wfile.close set wfile=nothing set fs=nothing '*** Writes the Categories out into a table. catCount = 0 %><% Do While catCount <= nCat aCategory = Split(aCategories(catCount),",") cCount = 1 '*** Writes out the Category heading %>") '*** In the line below, set colCount to equal the number of columns of listings you want. If colCount = 4 Then Response.Write("") colCount = 0 End If Loop %>
<% Response.Write("" & aCategory(0) & "
") '*** Writes out the contents of each category. Do While cCount <= UBound(aCategory) Response.Write("") %><%=aCategory(cCount)%><% Response.Write("   ") cCount = cCount + 1 Loop catCount = catCount + 1 colCount = colCount + 1 Response.Write("
<% End If End If %>