Don’t omit the commit

I’m slowly making progress at converting my old blog from Manila to WordPress; it looks like the simplest approach is to write a bunch of Python scripts to read the “content-only” version of the blog, resolve intra-blog references, and then directly insert the result into the underlying MySQL database using MySQLdb.

In testing this approach, I was trying to create a posting from scratch in a copy of WordPress running on my machine; I based the program on the examples I found here and here. But, even though the program seemed to work, and I could read the changes while the program was executing, but after the program finished, the database never reflected the changes — except that the ID for new entries kept increasing every time I ran the program.

It took me a long time to figure out what was wrong, but I eventually guessed it: I had to do an explicit “COMMIT” to have the changes I made from Python stick. I don’t know why the examples don’t show this, but it sure makes a difference.

More to come, I hope.

A catch in my referer log

One advantage of having a low-volume blog is that I check out my referer log fairly often. To be more accurate, I use the digested version provided by SiteMeter, which makes it easy for me to find out information about my hits, including search terms.

This morning, I noticed that someone had read more than one page on the blog and that they’d found it by doing a UK Google search for “parking lower slaughter”. Since I was curious, I re-ran the search and found that the top hit was on a site with the intriguing name of BeenThere-DoneThat. I clicked through, and liked what I saw (“the Unofficial Guide to Great Britain”), so I’m blogging it here so I have a chance of remembering it. I’ll also dogear it, but that’s only helpful when I have a connection behind the IBM firewall, something I try to avoid when on vacation.