dcsimg

Developing from Chaos Page 7

By ServerWatch Staff (Send Email)
Posted Mar 28, 1999


T.Mallard
The keyword list is done. Well, at the same time the keyword list is made, it's filed under product number in the database. This was an important pass and since it really was fast to add words to the omit list, I thought for the results, it took zero coding time, but definitely took script processing time. The next pass transforms the table data to set up the following step of inserting the keywords into the pages, with a final pass in this series, gns_dat_03i.asp, to take off the trailing comma after these keywords were added, an ugly detail which I took another pass for.

 

<%@ Language=VBScript enablesessionstate = false %>
<%
= true %>
<% Server.ScriptTimeOut = 2240 %>
<%
adate = date
sql_01 =""
lines = 0
done = 0
alreadys = 0
series = 0
i=8

set conn1 = server.createobject("ADODB.Connection")
conn1.open "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=X:\webshare\wwwroot\gns\cgi\gns_01.mdb"
set rsInput = server.createobject("ADODB.Recordset")
set rsCreate = server.createobject("ADODB.Recordset")
set rsOutput = server.createobject("ADODB.Recordset")
if i < 100 then
if i < 10 then
ctaba = "metas_00" & i & "a"
else
ctaba = "metas_0" & i & "a"
end if
else
ctaba = "metas" & i & "a" end if
if i < 100 then
if i < 10 then
htmlpage = "d:\webshare\wwwroot\gns\v1\prod_00" & i & ".html"
htmlOut = "d:\webshare\wwwroot\gns\v1\prod_00" & i & "a.html"
else
htmlpage = "d:\webshare\wwwroot\gns\v1\prod_0" & i & ".html"
htmlOut = "d:\webshare\wwwroot\gns\v1\prod_0" & i & "a.html"
end if
else
htmlpage = "d:\webshare\wwwroot\gns\v1\prod_" & i & ".html"
htmlOut = "d:\webshare\wwwroot\gns\v1\prod_" & i & "a.html"
end if

set conn2 = server.createobject("Scripting.FileSystemObject")
set input = conn2.OpenTextFile(htmlpage, 1, True)

if not input.atendofstream then
apage = input.readall
start = instr(1, apage, "</title>")
if start > 0 then
place = start + 8

set output = conn2.CreateTextFile(htmlOut, 8, True)

rsInput.open ctaba, conn1, 2, 3, 2
while not rsInput.EOF and not rsInput.BOF
metas = metas & rsInput("kword") & ","
rsInput.movenext
wend
if not isempty(metas) then
metas = mid(metas, 1, len(metas)-1)
else
metas = "no_keywords"
end if
mtag = "<meta name=""keywords"" content=""" & metas & """>"
thepage = mid(apage, 1, place) & mtag & mid(apage, place)
output.write(thepage)
lines = lines + 1
response.write(thepage)
response.write(i & ":i<br>")
response.write(start & "<br>")
response.write("place: " & place & "<br>")
response.write("lines: " & lines & "<br>")
end if
end if
set rsOutput = nothing
set rsCreate = nothing
set rsInput = nothing
input.close
set conn1= nothing
set conn2= nothing
set conn3= nothing
%>



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date