#!/usr/bin/perl -w use strict; my $V = 2; system("rm blag.txt*"); system("wget -q -O blag.txt http://mumble.net/~campbell/blag.txt"); open(BLAG, "blag.txt"); open(A, ">../HTML/blag.xml"); print A "\n"; print A "Taylor R. Campbell\n"; print A "This is Taylor R. Campbell's blag.\n"; my $year = (localtime)[5] + 1900; print A "All material in this file is © 2006-$year Taylor R. Campbell. All rights reserved.\n"; print A "John Cowan's stupid Perl script\n"; print A "Send comments to the email address with a host of the little-endian order of the domain net.mumble and with a username of campbell. Before reading this, please take a grain of salt and hold it in your mouth with your tongue against your cheek for several minutes; also, send in your sarcas-o-meter in for a tune-up just in case. Subtleties of sarcasm abound. (Some of the entries are serious, though. I think it is pretty obvious which ones are serious and which ones are not, but your mileage may vary.)\n"; print A "\n"; print A "http://www.ccil.org/~cowan/riastradh-$V\n"; print A "\n"; my $inentry = 0; my $intitle = 0; my $firstentry = 1; while () { if (/^2/) { chomp; print A "", substr($_, 0, 10), "T00:00:00Z\n" if $firstentry; $firstentry = 0; print A "\n" if $inentry; print A "\n"; print A "", substr($_, 0, 10), "T00:00:00Z\n"; print A "http://www.ccil.org/~cowan/riastradh-$V/", substr($_, 0, 10), "\n"; $_ = substr($_, 0, 10) . ":[No title]" if length($_) <= 10; print A "", esc(substr($_, 11, 1000)), "\n"; $intitle = 1; } elsif ($intitle && /^$/) { print A "\n"; print A ""; $intitle = 0; $inentry = 1; } elsif ($intitle || $inentry) { print A esc($_); } } print A "\n"; sub esc { my ($x) = @_; $x =~ s/^ *//; $x =~ s/&/\&/g; $x =~ s/