I wrote these for personal use, so the code isn't exactly the best in the world.. but as the standard disclaimer goes "it works for me". It's not GNU or whatever, just use it, if you decide to use it, give me a little credit, but don't blame me if it .. I dunno.. deletes the Internet or something. In other words, I like the attention, but I don't want the responsibility ;-)
Turn a folder full of LJ backup XML files into a bunch of HTML files:
Turn a folder full of LJ backup XML files into a bunch of files suitable for Movable Type's import feature:
The former outputs mostly-compliant
HTML, which is to say, it doesn't tidy up the HTML you use in your entries, but otherwise it's strict HTML 4.01.
The other thing both scripts do, which XSLT can't, is convert <lj user="blah"> and <lj-cut text="read more.."> to visible HTML. Both scripts have a setting which defines whether or not to show private/friends-only entries too (you might be rendering a local copy just so you can find stuff you've written in the past, or you may be rendering a "mirror" for your website).
It's pretty quick, but requires PHP's --with-xml
compile option so that the XML parser is installed. I think that's the default anyway, so most installations should have it. Run it from the command-line rather than the web, if possible. PHP 4.2.x and newer have a command-line version as well as a CGI/web-module version, though you can use the CGI version with the -q
option at a pinch.