Author |
Topic |
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 November 2001 : 16:22:11
|
UPDATED: 11.22.2001
This little script will generate static HTML pages with META Tags so that spiders and bots will be able to store topic discussions in Search Engines. I had my doubts at first that this would work but Iron Heart of http://www.someplacesomewhere.com has proven in fact that it does.
Here is a demo of the pages that are created:
http://www.nineinchnailz.com/forum/topics http://dayve.d2g.com:666/forum/topics/
if you double click on any html file it will redirect you to the actual forum topic. Viewing the source of that html file will show the META tag descriptions pertaining to that subject.
Installation:
Create a directory named topics that has WRITE permissions (uses fso object)
Download, modify and upload script in forum directory:
topicmaker.asp
Run the script which will take awhile to run and wait for confirmation message to appear.
All Done!! I have recorded google, alta vista and other search engines reading this directory as well as now seeing my forum topics in search engine queries.
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 17 November 2001 16:27:20
Edited by - dayve on 18 November 2001 17:56:56
Edited by - dayve on 22 November 2001 17:12:02 |
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 17 November 2001 : 16:25:33
|
The link for example gives an error.
Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
Azaniah
Senior Member
United Kingdom
1004 Posts |
Posted - 17 November 2001 : 16:38:14
|
Thanks - yeah thats pretty good
Cheers Az
------- Eagles fly!, but weasels don't get sucked into jet engines. |
|
|
blackinwhite
Average Member
Turkey
657 Posts |
Posted - 17 November 2001 : 17:02:08
|
bump, I have emailed it to you, dayve.
____ "I am a legal alien"
Edited by - blackinwhite on 17 November 2001 17:08:24 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 November 2001 : 18:31:09
|
quote:
bump, I have emailed it to you, dayve.
____ "I am a legal alien"
Edited by - blackinwhite on 17 November 2001 17:08:24
what email addy? I haven't gotten anything..
____________ dayve http://www.nineinchnailz.com/forum |
|
|
blackinwhite
Average Member
Turkey
657 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 17 November 2001 : 19:33:10
|
works for me...
just realized, that was a Private Forum for members only, that's why... guess I should tweak the script to omit private items...
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 17 November 2001 19:34:18 |
|
|
aavorio
Starting Member
10 Posts |
Posted - 17 November 2001 : 20:33:13
|
Hi,
There is an error with this scripts. Look:
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/forum/topicmaker.asp.asp, line 62
My Code:
<%Server.ScriptTimeout = 10000%> <!--#INCLUDE FILE="config.asp" --> <!--#INCLUDE FILE="inc_functions.asp" --> <!--#INCLUDE FILE="inc_top.asp" --> <%if (mLev = 4) then AdminAllowed = 1 else AdminAllowed = 0 end if %> <table align="center" width="60%" border=0> <tr> <td nowrap align="left"> <% if AdminAllowed = 1 then 'write_this = Request.QueryString("TOPIC_ID") for write_this = 1 to 1801 ' <<== manually set how many topics to read and create html files strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE " strSql = strSql & " FROM FORUM_TOPICS " strSql = strSql & " WHERE TOPIC_ID = " & write_this 'response.write strSql set rsWrite = my_Conn.Execute (strSql) strStatus = "" strWrite = "" if rsWrite.Bof and rsWrite.eof then strStatus = "<b>No such topic found.</b>" else set rsGetForum = my_Conn.Execute ("SELECT F_SUBJECT FROM FORUM_FORUM WHERE FORUM_ID =" & rsWrite("FORUM_ID")) forum_name = rsGetForum("F_SUBJECT") themessage = rsWrite("T_MESSAGE") strWrite = strWrite & "<html><head><title>" & rsWrite("T_SUBJECT") & "</title>" strWrite = strWrite & "<meta http-equiv=""Refresh"" content=""2; URL=http://www.myForum.com/forum/topic.asp?TOPIC_ID=" & write_this & "&FORUM_ID=" & rsWrite("FORUM_ID") & "&CAT_ID=" & rsWrite("CAT_ID") & "&TOPIC_TITLE=" & rsWrite("T_SUBJECT") & "&FORUM_TITLE=" & FORUM_NAME & """>" strWrite = strWrite & "<meta name=""Description"" CONTENT=""" & rsWrite("T_SUBJECT") & """>" strWrite = strWrite & "<meta name=""Keywords"" CONTENT=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """>" strWrite = strWrite & "</head><body>" strWrite = strWrite & "<table width=""100%"" border=""1"" cellpadding=""2"" cellspacing=""1"" bordercolor=""#3366CC""><tr><td align=""center"" colspan=""2""><b>" & rsWrite("T_SUBJECT") & "</b></td></tr>" strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getmembername(rsWrite("T_AUTHOR")) & "</b></td>" strWrite = strWrite & "<td>" & themessage & "</td></tr>"
strSql2 = "SELECT R_AUTHOR, R_MESSAGE " strSql2 = strSql2 & " FROM FORUM_REPLY " strSql2 = strSql2 & " WHERE TOPIC_ID = " & write_this 'response.write strSql set rsWriteReply = my_Conn.Execute (strSql2)
do until rsWriteReply.eof strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getmembername(rsWriteReply("R_AUTHOR")) & "</b></td>" strWrite = strWrite & "<td>" & rsWriteReply("R_MESSAGE") & "</td></tr>" rsWriteReply.MoveNext loop
strWrite = strWrite & "</table></body></html>"
Set ObjTopicFile = Server.CreateObject("Scripting.FileSystemObject") TopicFile = Server.MapPath ("topics/" & write_this & ".htm") Set WriteTopicFile = ObjTopicFile.CreateTextFile (TopicFile, True) WriteTopicFile.WriteLine(strWrite) WriteTopicFile.Close Set WriteTopicFile = Nothing Set ObjTopicFile = Nothing
[62] strStatus = "<b>Success.</b>"
%>
Thanks!
Edited by - aavorio on 17 November 2001 20:34:20 |
|
|
simonduz
Junior Member
161 Posts |
Posted - 17 November 2001 : 23:06:32
|
This is freakin slick.
Thanks for the great script. Simonduz |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
vinnyio
Starting Member
13 Posts |
Posted - 18 November 2001 : 15:53:11
|
I get this error too and could not find the answer to it.
Microsoft VBScript compilation error '800a03f6'
Expected 'End'
/forums/topicmaker.asp, line 62
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 18 November 2001 : 16:03:36
|
I'm sorry, I think I know why and I think I pointed it out in the original post.
for write_this = 1 to 2000 ' <<== manually set how many topics to read and create html files
this is a hard coded value, if you don't have 2000 topics then you will end up with an EOF error. I guess I should make this dynamic but in the meantime, set this value to a number lower than or equal to the number of topics on yor forum...
____________ dayve http://www.nineinchnailz.com/forum |
|
|
vinnyio
Starting Member
13 Posts |
Posted - 18 November 2001 : 16:23:20
|
Thanks for that but I am still testing my forums and have only 3 test topics so I set it = 1 to 3 and still get the same error I did the same with 1 to 2 and same error
I dont need to CHMOD anything as I am on Nt
Any ideas. Its not that really important but would be very handy.
|
|
|
blackinwhite
Average Member
Turkey
657 Posts |
Posted - 18 November 2001 : 16:28:10
|
quote:
works for me...
just realized, that was a Private Forum for members only, that's why... guess I should tweak the script to omit private items...
Dayve, could you check out the issue about private forums?
____ e? - Online Life and Design Culture-new!!
Edited by - blackinwhite on 18 November 2001 16:30:24 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 18 November 2001 : 16:44:13
|
quote:
Thanks for that but I am still testing my forums and have only 3 test topics so I set it = 1 to 3 and still get the same error I did the same with 1 to 2 and same error
I dont need to CHMOD anything as I am on Nt
Any ideas. Its not that really important but would be very handy.
the idea behind this is very simple so we will get it working. so now I ask Snitz v 3.1 or 3.3?
also, this is VERY important
quote:
Create a directory named topics that has WRITE permissions (uses fso object)
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 18 November 2001 16:45:42 |
|
|
Topic |
|