display | more...
Someone who is in the know should write an Apache module that parses .html files with text between square brackets just as everything does, replacing the text with a hyperlink that, if clicked, would direct them to the appropriate everything node. I would do such a thing, but dammit, Jim, I'm a systems administrator not a programmer!

See also: British Telecom, txt2e, the goat, Bell Engineering

ok.

package Everything::Parser;
use Apache;
use Apache::Constants;
use CGI qw(escape);

sub handler {
     my $r = shift;
     open(FILE, $r->filename) or return NOT_FOUND;
     $_ = join("", <FILE>);
     s/\[([^\]]+)\]/build_link($1)/egs;
     
     print $r->send_http_header("text/html");
     print;
}

sub build_link {
     my $node = shift;
     $escaped_node = escape($node);
     return "<a href='http://everything2.com/?node=$escaped_node'>$node</a>";
}

Log in or register to write something here or to contact authors.