Archive for March, 2005

How I Remapped My Permalinks

Thursday, March 31st, 2005

One of the biggest things that prevented me from moving to WordPress for a long time was the fact that if I switched, all of my permalinks would break. Fortunately, I came up with a good way of remapping every one them using a combination of Marc Nozell’s Blosxom to Wordpress migration tutorial, htaccess, and some code extracted from the Wordpress Moveable Type import utility. Here’s how I did it.

To start, I modified Nozell’s templates, which cause Blosxom to dump the weblog’s content in the standard Moveable Type export format, to include an additional “permalink” field for each post. I did this by simply adding the following to his story.mt template:

PERMALINK: /weblog$path/$fn.html

I then exported all of my Blosxom posts using this template, as described by Nozell.

Next, I extracted just the code that parses the Moveable Type export files from the Wordpress Moveable Type import utility (in “import-mt.php” under the “wp-admin” directory), put it into a separate file (which I call “import-generate-htaccess.php“), added a bit of code to extract the new permalink field from each post, and then put in a line to output mod_rewrite directives that map the old permalink to the new one based on that information:

print "RewriteRule ".$permalink." http://weblog.scifihifi.com/".$post_date."/".$post_name."\n";

When this code is run on the MT Export file Bloxom generates (by going to “wp-admin/import-generate-htaccess.php in your browser), it dumps to the browser a mapping between your old post URLs to your new ones. Simply put these rewrite directives in an htaccess file at the root of your old weblog (making sure to enable rewrites first in the file), and voila: your old permalinks now redirect to your new ones.

This way of doing things is very hacky, of course, and the actual steps involved will differ a lot depending on peoples’ setups. I thought I’d at least share the general idea, though, in case someone else is in the same boat.

Combined RSS Feed

Thursday, March 31st, 2005

While I’m messing around with my weblog, I figure I might as well take advantage of FeedBurner to offer one of those composite RSS feeds that includes my weblog posts, a daily summary of my del.icio.us links, and my Flickr photos. I’m not sure how many people it will appeal to (in fact, I know some people find combined feeds like that downright annoying), but, hey, it’s free and easy to do, so here it is.

It’s Not Just a Hobby Anymore!

Tuesday, March 29th, 2005

Del.icio.us addicts take note: this afternoon our dear leader finally announced that he is quitting his day job to focus on del.icio.us development full-time. And not a moment too soon: how many weeks now has the Inbox claimed that it would be back “hopefully this week?”

In all seriousness, though, it’s nice to see Joshua get the recognition (monetary and otherwise) that he deserves for kicking off the folksonomy boom. It’s also good to hear that he seems to recognize the true reason for his (and any social software’s) success: an enthusiastic community of interesting users. Here’s hoping del.icio.us can maintain it’s excellent signal-to-noise ratio now that the wider world is beginning to catch on.

Cocoalicious and Scuttle

Friday, March 25th, 2005

If you’re as much of a del.icio.us addict as I am, you may have noticed that someone finally got around to releasing Scuttle, an open source, self hosted del.icio.us clone, a few days ago. I’d been waiting for this to happen for sometime, so that people could take advantage of a feature I put into Cocoalicious a little while ago: the ability to set the API URL prefix to something other than “http://del.icio.us/api/” (in the preferences window).

I put in a feature request for a del.icio.us API implementation on the project’s SourceForge page, and to their credit, the developers claim to have already knocked one out. So now Scuttle users should be able to set the API URL in Cocoalicious to the Scuttle installation on their own server and get all the same benefits as del.icio.us users.

I haven’t tried it out yet, but I think it should be a pretty cool thing for both projects.

Switching to WordPress

Friday, March 25th, 2005

The other day I finally got around to deleting all of the comment spam my weblog has accreted over the past few months, only to discover that the numerous attacks I’ve suffered have had the unfortunate side effect of deleting a lot of my existing comments! I’m not sure how this could have happened, but I think it has something to do with the weird, hacked-up version of the standalone Moveable Type comments script I’m using. Suffice to say, I no longer trust my Blosxom setup.

This, combined with the fact that I attended the WordPress 100,000 party the other night, and the fact that Jonas Luster (one of the first people I got to know in California) is now employee #1 of WordPress, Incorporated, and the fact that I like MarsEdit and want weblog software that allows me to use it with a minimum of fuss, has finally convinced me to switch to WordPress.

(Update: The above statement is no reflection on Allen Hutchison’s XML-RPC implementation for Blosxom, BXR. In fact, the existence of BXR was one of the only things that kept me from switching a long time ago. My switch had a lot more to do with the other factors I mentioned, while WordPress’ out-of-box XML-RPC support was merely a nice perk.)

I mention this to you, the reader, because it means things are going to be a bit messy around here for awhile. I managed, for example, to get all of my old posts imported into my new WordPress rig, but not their associated comments. I also have a difficult task ahead of me in getting links from my posts to other posts pointing at the correct WordPress permalinks (and setting up an .htaccess file that maps my old Blosxom permalinks to their new Wordpress equivalents). Since I don’t have a lot of spare time on my hands, it might take me awhile to set all of this right.

Hopefully in the end it will all be worth it, though. WordPress 1.5’s admin interface already feels incredibly refined and easy to use compared to the rickety collection of Perl variables I used to negotiate to configure my Blosxom setup. And the fact that I can now approve comments before they’re posted on the site should more or less solve my spam problem.

Be Healed, Esther Dyson

Tuesday, March 15th, 2005

I just can’t resist pointing it out: in this ETech photo (by the multi-talented James Duncan Davidson), Jeff Bezos looks an awful like a televangelist performing a faith healing. And people say Apple is a cult!

The Minister of Search at ETech

Tuesday, March 15th, 2005

If you happen to be where I wish I was right now (in San Diego at the O’Reilly Emerging Technology Conference), you might want to stop by the Apple Booth and say hello to my co-worker (and the Cocoalicious project’s minister of search) Andrew Wooster, who will be there tomorrow morning. He’s an agreeable fellow and will be glad to chat about anything from OS X to the web to the superiority of California’s weather.

In Your Face, O’Reilly!

Saturday, March 12th, 2005

It’s not even officially spring yet, but the recent unseasonably warm weather in the Bay Area has already had me pining away for last year’s “Summer of Buzz.” As torturous as that can be when you’re stuck in an office verifying Tiger bug fixes, at least it has gotten me thinking about and planning for some of this summer’s activities, chief among them my aforementioned WWDC dinner.

As I said in my last post on the subject, this year I was really hoping to secure The Thirsty Bear as our venue. As much as I enjoyed last year’s event at Bucca di Beppo, I was a little disappointed that the rigid seating arrangements there didn’t allow people to circulate more, and I think the big open room above The Thirsty Bear would be much more conducive to socializing (it even has a pool table and dart boards!). Plus, the food and drink are light years ahead of Bucca di Beppo for not that much more money.

Fortunately, since I got a reservation early this year, I was able to beat O’Reilly and whoever else had the Bear all booked up around WWDC-time last year. Based on my previous straw poll, I made the reservation for 40, but this can be adjusted up or down as we get closer to the event and peoples’ plans become clearer.

Last year I stressed quite a bit about the payment details, but in the end everything actually worked out great, because everyone simply threw money at me the last minute (I think I ended up making money on the deal!). In light of that, and having been inspired by Merlin Mann’s informal collection for his 43 Folders MacWorld Meetup, here is what I’ve decided to do:

  • Sci-Fi Hi-Fi will put up the money to secure a private bartender for the evening (tax writeoff don’t you know—gotta wine and dine all those industry bigwigs!).
  • I have set up a DropCash campaign to collect money for the food. The minimum food purchase The Thirsty Bear requires for an event like this is $18/person ($21.60 with tip), which, with tip, puts out target around $868. This will essentially buy us lots and lots of excellent tapas (a variety of Spanish small plates for the uninitiated) which people can munch on casually as they mill about discussing Tiger or RSS or what have you.

I like this informal arrangement because it allows people who have a little more money to spend to possibly subsidize some of the people who have less (i.e. students). Anyone who donates to the “student fund” by contributing more than $21.60 will receive recognition for that somehow (I’ll have to figure out exactly how later).

That’s about all for now, other than to note that the event’s official web page is now live. More later…

Cocoalicious 1.0b32

Thursday, March 3rd, 2005

Beta 32 of Cocoalicious brings both good news and bad news for our friends abroad. The good news is that I finally became ashamed enough of the app’s issues with posting international text that I fixed them (that’s why I had those Japanese Amazon links in my bookmarks for awhile, in case anyone’s wondering), and b32 now properly handles submission of unicode to del.icio.us. The bad news is that there is a character encoding problem in the XML returned by the del.icio.us API that prevents unicode from working properly in tags.

For those who care, the crux of the problem is that the XML returned by the “/api/posts/all” call is encoded as UTF-8, except for the contents of the “tag” attribute of each post element, which appears to contain text of some other encoding (UTF-16?). The problem is easy to see if you post a link and put the same non-ASCII characters in for both the extended text and the tags, then look at the XML output of “/api/posts/all.” The “tag” attribute and “extended” attribute will contain different data, even though both should be the same.

I’ve been working with Joshua on resolving this problem, so hopefully it will eventually disappear (or maybe if I get impatient enough I’ll bow to Postel’s law and implement a workaround). For now, I guess, just be advised that tag filtering with non-ASCII characters will not work correctly in Cocoalicious.

Beta 32 also contains a few nice patches and suggestions that people submitted:

  • Ken Ferry finally implemented something people like Jon Hicks have been wanting for awhile now: services support. Using this feature, users can highlight a URL in any services-capable app (including almost all Cocoa apps), and either choose App Menu > Services > Post URL via Cocoalicious or press command-^ (shift-command-6) to send the URL to Cocoalicious for posting. This means that it’s easy to post from other browsers, such as OmniWeb and Camino (although, sadly, not Firefox, since it doesn’t support services).

    (Update: To get the services support to work, make sure Cocoalicious is installed in /Applications, and that you have logged out and back in after installing the new version.)
  • Diggory Laycock submitted a patch which adds a handy dock menu, making “New Post” and “New Post from Safari” accessible when Cocoalicious is not the active application.
  • John Gruber contributed his eye for UI detail and pointed out a few things that needed fixing here and there (most notably the lack of an obvious way to re-open the main window after it is closed). His suggestions have been incorporated into this release.
  • Jason Deraleau wrote a very nice post about the full-text search feature, but mentioned that he wanted a way to index a single post, rather than having to constantly re-index his entire bookmark collection. This was a just criticism, so I added a more obvious menu item to index only the selected post (incidentally, pages also get indexed every time you open them in the web preview pane, but that’s not very obvious). Eventually I would like to add an option to make the indexing happen at the time of posting, but for now this is a good workaround.

Thanks, as always, to everyone who contributed! Oh, and if you’ve submitted a patch I haven’t incorporated yet, I apologize—soon, I promise!