Monthly Archives: March 2008

Job Search 2.0

Looking for a job has certainly changed since the last time I actively searched for a job.

My entire job search consisted of this blog post, and this tweet on Twitter. (Ok, I did send a couple of e-mails, but it sounds better if it’s just the blog and Twitter). Within 2 hours, I had 4 serious inquiries and 11 in total by the end of the first day. That’s pretty good, considering that I live on an island outside of Seattle, and not in the Bay Area. Interestingly enough, only two of those inquiries were from companies with physical offices in the Seattle area.

Having a blog turned out to be quite important. At least one opportunity came via e-mail with a preamble that went like this: “You don’t know me, but I’ve been a reader of your blog for a long time”.

Until about 2 weeks ago, I talked to a lot of people on the phone, and went to California two weeks in a row for in-person interviews (those of you following along on Twitter already know this — it’s sad but true that Twitter has eaten into my blogging). I feel very fortunate that the four companies that I preferred the most were all fine with the notion of me continuing to work remotely. All four of these companies were doing really interesting stuff. It just goes to show that you don’t have to live in Silicon Valley in order to have access to interesting work opportunities.

I’m going to save the identity of my new employer for tomorrow’s post. But in this post, I would like to say “Thank You” to everyone who contacted me with a job opportunity, and to those who dropped me a note just to find out what was up or how I was doing. It’s nice to know that you have friends.

Moving from Movable Type 3.2 to WordPress 2.3

Julie has decided that she wants to blog a little more frequently. One obstacle to this is that her blog is a spam magnet – or it was until I deleted the Movable Type comment CGIs as a last ditch defense. I’ve had very good results with Akismet on WordPress, so inevitably this meant an upgrade from Movable Type to WordPress. It was only a matter of time before this happened, especially now that I am on WordPress myself. Importing is pretty straight forward. It’s making sure that the permalinks don’t break is the problem. In order to do that you need to make sure that WordPress uses the same numerical id’s that Movable Type used. Which means that you have to hack Movable Type to add an ID field to the exported data, and hack WordPress to use that ID when it creates the new blog entries. Then you do a little mod_rewrite action, and the permalinks should keep on ticking. I’ll now proceed with describing the hacks.

I started with the basic WordPress docs to migrate from Movable Type to WordPress.

Go into the Movable Type 3.2 install and edit lib/MT/ImportExport.pm to add an ID field:

--- ImportExport.pm     2008-02-17 17:55:19.000000000 -0800
+++ ImportExport.pm~    2006-01-04 00:21:09.000000000 -0800
@@ -439,7 +439,6 @@
     my $tmpl = MT::Template->new;
     $tmpl->name('Export Template');
     $tmpl->text(<<'TEXT');
-ID: <$MTEntryID$>
 AUTHOR: <$MTEntryAuthor strip_linefeeds="1"$>
 TITLE: <$MTEntryTitle strip_linefeeds="1"$>
 STATUS: <$MTEntryStatus strip_linefeeds="1"$>

I used Joshua Zader’s modified mt.php and modified it some more so that it would work off of a local file since the MT 3.2 export was over 7MB.

--- /tmp/mt.php 2006-03-27 17:15:00.000000000 -0800
+++ mt.php      2008-02-17 20:51:53.000000000 -0800
@@ -1,7 +1,9 @@
-f<?
+<?
 
 // HERE I'M DEFINING A CUSTOM FUNCTION BASED ON THE ORIGINAL WP_INSERT_POST FUNCTION LOCATED IN IN FUNCTIONS-POST.PHP
 
+set_time_limit(0);
+
 function wp_insert_post_with_id($postarr = array()) {
        global $wpdb, $wp_rewrite, $allowedtags, $user_ID;
 
@@ -287,7 +289,7 @@
 
        function get_entries() {
                set_magic_quotes_runtime(0);
-               $importdata = file($this->file); // Read the file into an array
+               $importdata = file('/usr/share/wordpress/wp-content/mt-export.txt'); // Read the file into an array
                $importdata = implode('', $importdata); // squish it
                $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);                
                $importdata = preg_replace("/\n--------\n/", "--MT-ENTRY--\n", $importdata);
@@ -371,7 +373,8 @@
        }
 
        function select_authors() {
-               $file = wp_import_handle_upload();
+/*             $file = wp_import_handle_upload(); */
+                $file['file'] = '/usr/share/wordpress/wp-content/mt-export.txt'; 
                if ( isset($file['error']) ) {
                        echo $file['error'];
                        return;

I hope this will save some poor person the time I wasted piecing all this together. Most of the documentation that I googled up was for earlier versions of either Movable Type or WordPress or both. Really, some right thinking, PHP handy person ought to just go in and fix the Movable Type importer and document how to use the Movable Type template in order to make this all work.

Oh, and if you’re going to run multiple WordPress blogs with different url prefixes on a Debian supplied WordPress, then you are going to need this.