Friday, January 11, 2008

Third Thing

3. I remember! The third thing is that along with how the blog is now separated into two departments instead of five, I changed the method that the blog entries are reposted onto the compendium. Instead of having an email client always running that re-sends the posts to Blogger (as described in Me? Blogging?), I’ve had to change things around a bit. With the transition to New Blogger that allowed me to consolidate the blogs, something broke with how Blogger parses special characters. My department blogs have an em dash in their namesthat thing. The problem is, you can’t find an em dash on a keyboard; it’s a special, high-ASCII character like • or æ or . Unlike the lower-128 characters (everything you actually see on a keyboard: letters, numbers, normal special characters like $%&@), there’s no standard ASCII code for the upper-128 characters, which, on the Mac, includes the em dash (option-shift-hyphen), but on other systems may not. So HTML threw its hands up and instituted what’s called HTML Entities instead, where special characters are represented by codes like — and • (which result in — and •, respectively). The problem in this case was that Blogger started escaping these codes, so the department links at the bottom of the posts on the main page started looking funky. Instead of sending "Genius/Idiot&mash;Current Thoughts" (embedded in a link, of course), it sent "Genius/Idiot&&mash;Current Thoughts" which resulted, instead of Genius/Idiot—Current Thoughts, in Genius/Idiot—Current Thoughts. Not what I wanted.


Of course, the easy thing to do here would just be to give up and change the department blog names, to something like Current Thoughts or Genius/Idiot--Current Thoughts. But I’m not well known for doing the easy thing; I wanted it pretty. Instead, I spent many long days over a period of several months—most of last year, really—learning enough UNIX to do this by hand on my own computer (the Mac is now based on a UNIX operating system, in case you didn’t know). In the end, I had to go to an incredible rigamarole in order to save my silly em dash. Here’s the new setup (this replaces step 6 in Me? Blogging?):

6. Blogger emails the post to an email account I have set up on my own computer (I have a static domain name provided by staticcling.org). It comes in, is handed off to Procmail for processing, which hands it off to formail to modify the header so that Blogger would take it back (took forever to figure that bit out), then hands it off again to sed for lots of reasonably complicated text processing, to make it look like it used to look before Blogger broke it (Blogger had changed some style stuff as well). Procmail then sends it to Postfix, a UNIX mail server, which shoots it back off to Blogger.



This was at least as hard as it sounds to figure out how to do. I could never have done it without the Procmail Quick Start and a nifty program called Postfix Enabler. I’m cheap; I fought with .conf files and a bunch of stuff I don’t even remember anymore (God help me when I need to change computers; I have no idea how I did all this) for days before I finally gave up and paid the $10 for Postfix Enabler (a Mac front-end for Postfix). I was a fool. What I failed to do in two or three days, Postfix Enabler did in two or three clicks. I love the Mac .

No comments: