Linking Plain URLs in Movable Type Comments

I run an active Movable Type-driven site where visitors include hyperlinks in their comments using HTML markup like this:

Read more on <a href="http://ekzemplo.com">Ekzemplo</a>

A lot of people don't know HTML, so they paste URLs:

Read more on http://ekzemplo.com

This is less useful and causes presentation problems when a long URL takes up more space than the site's tables can handle, pushing the right margin off the edge.

I needed to turn plain URLs into hyperlinks without messing up existing links in HTML, so I tried Brad Choate's Regex plug-in, which enables regular expressions to process any Movable Type tag's output.

With a lot of trial-and-error and the help of an online regex tester, I used the plug-in's MTRegexDefine tag to define three find-and-replace regular expressions (in Perl syntax):

A global tag attribute, regex, causes these expressions to be used on its output:

<MTCommentBody regex="1">

Plain URLs are converted to hyperlinks with their domain as the linked text. The order of the regular expressions is important; the plugin invokes hideanchor, longurl, and then showanchor in that order.

May Diverse Be With You

The ongoing debate over weblogger diversity leaves me wishing there were better tools to find new voices making their way up the long tail.

I'm too lazy to find them on my own (with the exception of new bloggers in Jacksonville and St. Augustine), so I link to the same people often -- mostly the crowd of plugged-in web technologists who I have read for years.

They are admittedly a largely white and male group, but I assuage my liberal guilt by linking often to Bill Lazar, who as you may not realize is a transgendered teen-aged Cuban-American evangelical whose mother was a notch baby.

In the early days of weblogging, when we had to compose our RSS feeds by hand and walk six miles uphill to and from school, there was a service that highlighted new blogs that were just starting to attract attention. Or maybe it listed new memes just starting to attract blogs. The memory is the second thing to go.

Using the Technorati API, I have written Java code to grab some XML data that quantifies how popular a weblog is, putting together an element like this:


Noodle Pie
http://noodlepie.typepad.com/
9859
113
145

I'm fomenting plans for a web service built on this data and Weblogs.Com that can find and present new blogs, using a metric that catches them when they start to attract a following.

For instance, the site could display new posts from weblogs that have at least 25 and no more than 50 inbound blog links.

I don't know yet how successful it would be in presenting blogs worth finding, but there can never be too many programmers working on a cure for information obesity.

John Scalzi believes that the real dividing line in this polarized country is not liberal vs. conservative, but rational vs. irrational:

I'm far more comfortable with some conservatives than I am with some liberals, even though my own positions tend more liberal than not. I'm rather more comfortable dealing with someone whose politics I disagree with, but I can see how they got to where they are, than someone who politics are in line with mine but who appear to have arrived at those politics without an intermediary step of, you know, thinking about those politics.

Church of the Risen Elvis

Because Atlanta courtroom killer Brian Nichols was read parts of The Purpose-Driven Life by his last hostage, CNN is republishing an interview the book's author did last November on Larry King Live.

The book sounds like 336 pages of merciless flogging, based on the simplistic platitudes that the author, Rev. Rick Warren, inflicts on King ("The middle letter of pride is I, and the middle letter of sin is I"). The middle letter of tripe is I, too, reverend.

But I'm linking to call attention to this comment (emphasis mine):

The problem today, Larry, is not unbelief. The problem is today everyone wants to believe everything. They want to believe it all. I want to believe in reincarnation and heaven. Those are mutually exclusive things. I want to believe in Elvis, and I want to believe in Jesus -- those are mutually exclusive.

One of my favorite science fiction novels, Dreamships by Melissa Scott, is set in a future in which Elvis Presley fandom has shifted from adulation to idolatry. The Church of the Risen Elvis is an established denomination and "Elvis Christ!" a common curse.

As a longtime resident of the South, I could see the King eventually becoming a challenge to the King of Kings, but I didn't know that true believers already had to pick sides.

All of My Distortions Lack Purpose

Dick Rogers, ombudsman of the San Francisco Chronicle, compares bloggers to the ink-stained wretches in his profession:

Other [bloggers] poke at contemporary issues but toss responsibility out the window. Five minutes with an Internet directory such as www.globeofblogs.com will turn up blogs that don't even bother to guess at the truth. They traffic in falsehood, innuendo and purposeful distortion. Journalism? I sure hope not.

I challenged him in e-mail to name five actual weblogs that run knowingly false and distorted items. I can't think of five, much less find five new ones in a quick skim of a weblog directory.

If he had accused webloggers of being less cautious in their claims than pro journalists, I'd agree. One reason caution flies out the weblog is the ability to learn about and correct mistakes in record time.

I worry less about making errors on Workbench than I did working at a newspaper, because I know people are more likely to call me on them quickly. Every comment thread is an opportunity for a reader to tell the world I'm stupid.

The weblog format also lends itself much better to corrections than a newspaper. All my corrections get exactly as much play as the original gaffe.

Mark Pilgrim Monkeys Around

Mark Pilgrim's half-year search for a hobby that doesn't involve electricity appears to have been as fruitless as O.J. Simpson's hunt for the "real killers."

Pilgrim, who's being Michael Corleoned back into blogging on IBM's new PHP weblog, has recently released a script for GreaseMonkey, the Firefox plug-in for editing web content a la autolink.

The script removes everything but links on sites published by Robert Scoble.

Pilgrim also has released a new open source beloved butler that does to Google what it wants autolink to do to the rest of the Web (screenshot).

Like Winer Watcher, Pilgrim's new ScobleFucker is another meticulously programmed fuck-you that could be rewritten to serve a useful, non-malicious purpose.

But as he'd probably ask, where's the fun in that?

A Marine who attended President Bush's speech at Camp Pendleton disagrees with my fashion critique:

Most Marines I talked to didn't even know what that jacket was, they thought is was Pres. Bush's personal jacket he had modified. As for the flight suit thing, he was flying on a Naval aircraft landing on a Naval aircraft carrier, he had to wear one! Hell we gave the Discovery channel guys flight suits when they flew on my ship in 1998.

In retrospect, I should have been skeptical of reporter Dana Milbank's claim that Bush was setting a new trend with his faux-military presidential duds. I still think the jacket was too Lord Farquaad, but Clinton and his recent predecessors also liked to play dress-up, as does President Bartlet.

Of all the photos offered by InstaPundit readers as proof that I should wear a "Jackass-in-Chief jacket," the one from West Wing stung the most. I hold that fictitious liberal presidency in great regard.