Lessig 2.0, v2 Now Live! + A Conversion Tool and Test Suite for MovableType to Move from One URI Scheme to Another
Update: ok, a little hiccup. But now we’re back, and so too are the thanks.
So that was fun :) Yesterdays launch of Lessig 2.0 turned into last nights and this mornings hack session to both fix and then build out a test suite to ensure that all of the old links were properly and permanently redirected to the new links.
I need to spend some time both documenting and
prettying up the interface, but my guess is that this isn’t the first time someone will want to automate the conversion and subsequent testing of moving from one URI scheme to another (e.g. 000123.shtml to /year/month/day/title.ext). At present time this is specific to MovableType, but it really doesn’t have to be. I’ll work on making it more generic, but in the mean time if you want to play around with the code base, the overview of how it works and links to the code follow below.
svn co http://extf.googlecode.com/svn/trunk/WebApp/
Firstly, take and create a MovableType template with it inside of the MT instance *BEFORE* you make changes to the URI scheme. Name the output file something like “mt-archive-old.xml”. Generate a file w/ “Save and Rebuild.”
Secondly, make the change to the URI scheme, change the name of the output file to something like “mt-archive-new.xml”. Again, “Save and Rebuild”.
Start up the local web server (this requires either MS.NET or Mono) using one of the startup scripts from the above SVN checkout. INSERT: Just realized I need to adapt the script to auto-generate the .htaccess file or the Web.config file for an IIS-based MT install (is there even such a thing? ;-) At the moment that requires a separate step from the command line. I’ll fix that and update this post later this morning.
I’ll provide extended documentation when that last piece is ready, but in the mean time, a quick overview of how it all works,
This[2, 3] takes the URI of the old archive file and the new archive file, dynamically generates an archive comparison list, and then runs through each one of them, accessing the old URI to ensure that the document you are redirected to contains the same title as the original document from the old URI scheme, returning the pass/fail result in chunks of 10-15 every 10-15 seconds.
As mentioned, I’ll get this cleaned up and better documented, but in the mean time this should provide some fun stuff to play with. Of course to qualify as “fun” requires you to be a phreak-geek like me, but none-the-less, fun. :D
Oh, and more to follow on the Lessig 2.0 front. There is a Lessig Mixter site that is up and running, but needs to be filled with content to be, you know, remixed. That’s a process that will soon be in process. Also, to provide credit where credit is due, this time around the site design was done by the ever impressive talents of Ryan Gantz while I spent my time developing the backend system, something in which will be continually added to and the code made available inside of the same SVN repository linked to above.
And with that, enjoy your collective DevDays! :D