#!/opt/gnu/bin/perl # Converts a Simpsons-related text file to URL, with a header & footer # and a bit in the middle inside
's # It also finds Episode codes and changes them to links. # Howard Jones, October 1994 (ha.jones@ic.ac.uk) # use as: shtml "This is the Title"sourcetext.html $title="This is the title"; $title=$ARGV[0]; print "\n\n"; # put a decent header on it print " $title \n"; print "\n"; print "\n\n"; print "$title
\n"; print "\n"; while(\n"; # plop a decent footer on too # and a credit line (why not?) # This can be any line thats wanted on all files (like a 'home page' button) print ") { study; # do the standard HTML escapes s/&/&/g; s/</g; s/>/>/g; s/"/"/g; # now find the Simpsons episode production codes # First, converts them to uppercase, then to the right URL s/([0-9])f([0-9])/\1F\2/g; # this sucks! s/([0-9])g([0-9])/\1G\2/g; # (but it does work) # may need to change this line to point to the right files # (it should really start with a / and be the whole path, anyway) s|\[([0-9][FG][0-9][0-9])\]|\1|g; print $_; } print "
\nConversion by Howard Jones (ha.jones@ic.ac.uk)\n"; print "\n\n"; __END__ -- Howard Jones Microsoft - Making Things Slower Internet: ha.jones@ic.ac.uk Mail replies may take more than a week.