UBB.Dev
Posted By: Nat Fairbanks static html from archived forum - 12/24/2002 3:49 PM
OK, quick summary first. The town of Merrimack, NH, USA had been running a ubb.classic web forum until last month. On November 14th the town selectmen (a board of 5 elected officials responsible for running the town) voted to close it down. You can see the locked/closed forum at http://www.ci.merrimack.nh.us/ubb-bin/ There is also a http://www.townsforum.com/HollisNHforum/viewtopic.php?t=270 collection of newspaper articles about forum closure on another web forum for a nearby town.

The town has archived the data, and as a citizen I've gotten a copy of the data (no licensed code, just the text based files that the cgi-bin would read from) and I'm looking for a simple and quick way to generate passable static HTML from these flat files. Is a tool like this available? If there isn't a tool available is there a description of the file format? It's clear that || is a field delimiter, but many of the fields are blank.

I don't want to run a forum using this data, I simply want to make it available for reading online.

Thanks,
-Nat
Posted By: Nat Fairbanks Re: static html from archived forum - 12/24/2002 3:56 PM
I've put together a quick and dirty perl script to generate static HTML already, but some of the field values still elude me. Any ideas?

Thanks,
-Nat
Code
#!/usr/local/bin/perl

open INDEX,"> index.html" or die "could not open index.html : $!n";

print INDEX << "EOF";
<html>
<head>
<title>Merrimack town forum read only archive</title>
</head>
<body bgcolor="EEEEEE" text="#000000" vlink="#1111FF" alink="#222222" link="#FF1111">
<table border=2><tr>
<th>Topic Marker</th>
<th>unkn1</th>
<th>Num Replies</th>
<th>Author Name?</th>
<th>Subject</th>
<th>unkn5</th>
<th>unkn6</th>
<th>unkn7</th>
<th>User name?</th>
<th>unkn9</th></tr>
EOF

foreach $topic (@ARGV) {
open TOPIC,"< $topic" or die "all args must be a UBB flat file (000###.cgi) file name : $!n";

open HTML,"> ${topic}.html" or die "can't open ${topic}.html for writing : $!n";

$line=<TOPIC>;
($topic_header, $unknown1, $num_replies, $author, $subject, $unknown5, $unknown6, $unknown7, $user_name, $unknown9) = split(/||/,$line);

print INDEX "<tr><td>$topic_header</td><td>$unknown1</td><td>$num_replies</td><td>$author</td><td><a href="${topic}.html">$subject</a></td><td>$unknown5</td><td>$unknown6</td><td>$unknown7</td><td>$user_name</td><td>$unknown9</td></tr>n";

print HTML << "EOF";
<html>
<head>
<title>$subject</title>
</head>
<body bgcolor="EEEEEE" text="#000000" vlink="#1111FF" alink="#222222" link="#FF1111">
<table border=2><tr>
<th>Topic Marker</th>
<th>Reply Number</th>
<th>Author Name?</th>
<th>Date</th>
<th>Time</th>
<th>email addr</th>
<th>IP</th>
<th>registered?</th>
<th>unkn9</th>
<th>User name?</th>
<th>unkn11</th>
<th>unkn12</th></tr>
EOF

while ($line=<TOPIC>) {
($tm, $rn, $an, $date, $time, $email, $post, $ip, $reg, $unkn9, $un, $unkn11, $unkn12) = split(/||/,$line);

print HTML "<tr><td>$tm</td><td>$rn</td><td>$an</td><td>$date</td><td>$time</td><td>$email</td><td>$ip</td><td>$reg</td><td>$unkn9</td><td>$un</td><td>$unkn11</td><td>$unkn12</td></tr>n";
print HTML "<tr><td colspan=12>$post</td></tr>n";
}
print HTML << "EOF";
</table>
</body>
</html>
EOF

close HTML;
close TOPIC;

}

print INDEX << "EOF";
</table>
</body>
</html>
EOF

close INDEX;
Posted By: Burak Re: static html from archived forum - 12/24/2002 6:06 PM
Allen or someone else, posted an info about ubb member slots... But there may be another thread for ubb thread info... Try to search (but they can be a little old) Anyway, Charles Capps or an UBB mod writer can give real info I believe...
Posted By: AllenAyres Re: static html from archived forum - 12/24/2002 9:16 PM
we have a thread about current profile fields in the beta forum for 6.3 and 6.x smile
© UBB.Developers