I'm fiddling with WordPress trying to decide if I want to switch to it. My blog is at Powerblogs, so there's not a trivial way to transfer posts, etc.
I wrote a perl script to convert my present blogroll to an OPML file so I could upload it, but the upload consistently fails. The error message is
XML error: Invalid document end at line 1
I've read extensively at opml.org, studied several example opml files and read the code in wp-admin/link-import.php.
I can't for the life of me figure out what's wrong.
Here's the perl script
#!/usr/bin/perl
my $file="blogroll_list_0.html";
my $output="blogroll.opml";
my ($one, $two, $three, $four, $five, $six, $seven, $eight);
print "<?xml version="1.0"?>n";
print " <opml version="1.0">n";
print " <head>n";
print " <title>"Blogroll"</title>n";
print " <dateCreated>Thu, 15 Feb 2007 03:24:18 GMT</dateCreated>n";
print " </head>n";
print " <body>n";
print " <outline type="category" title="Blogroll">n";
open(FILE,$file) or die "Can't open $filen";
while(<FILE>) {
($one, $two, $three, $four, $five, $six, $seven, $eight) = split(/[<>=]/,$_,8);
print " <outline text="$seven" type="link" xmlUrl="" htmlUrl=$six updated="" />n";
}
close(FILE);
print " </outline>n";
print " </body>n";
print "</opml>n";
Here's a small part of the file (I have 274 blogs in my blogroll.)
<?xml version="1.0"?>
<opml version="1.0">
<head>
<title>"Blogroll"</title>
<dateCreated>Thu, 15 Feb 2007 03:24:18 GMT</dateCreated>
</head>
<body>
<outline type="category" title="Blogroll">
<outline text="J Barne's Coffee Shop" type="link" xmlUrl="" htmlUrl="http://jbarnescoffee.blogspot.com/" updated="" />
<outline text="Jennifer's History and Stuff" type="link" xmlUrl="" htmlUrl="http://jenlars.mu.nu/" updated="" />
<outline text="Jeremiah Stoddard" type="link" xmlUrl="" htmlUrl="http://www.jeremiahstoddard.com/" updated="" />
..............
<outline text="A Youth's View from the Right" type="link" xmlUrl="" htmlUrl="http://tokenyoungconservative.blogspot.com/" updated="" />
<outline text="Zenpundit" type="link" xmlUrl="" htmlUrl="http://zenpundit.blogspot.com/" updated="" />
</outline>
</body>
</opml>
So what the heck am I doing wrong?