|
WordPress as a loosely-coupled comment engine
My quest for a loosely-coupled
comment system has led me to the same conclusion Dave Winer
reached a while ago: Use WordPress. Rather than cross-posting to my
WordPress comments blog, though, I'd like to use it as a kind of a web
service that I can integrate into my existing blog. And I'd like
to do that as portably as I can, so that the glue can be repurposed
for any blog publishing system I might switch to, as well as for any
other comment service I might switch to.
I haven't created the glue yet, I'm just doing things manually in
order to think through what the glue needs to do. So far I've
identified these functions:
-
Create placeholders in WordPress. I see no reason to replicate
the bodies of my postings on the WordPress side. I'll just post
stubs
there that link back to my real blog. To make it easier to stitch
things together, I'd like to embed the serial number of my Radio UserLand
posts into the WordPress URLs. So for example:
weblog.infoworld.com/udell/2006/09/23.html#a1529
jonsradiocomments.wordpress.com/2006/09/24/a1529/
That might not be straightforward, though. In this example, the original WordPress URL was something like:
jonsradiocomments.wordpress.com/2006/09/24/how-translucency-could...
The descriptive trailing part of the URL, called the post slug,
is derived automatically from the title. You can change it
interactively, and I did, but that's a nonstandard feature and so
isn't supported in any of the weblog APIs. I might instead have to
embed the serial number in the title.
-
Monitor the WordPress blog for comments. I can schedule a
process to watch the main
comments feed and, when a new comment appears, I can collect the
whole set of comments for that item using the per-item
comments feed.
-
Include comments directly in the main blog. I'm weighing a
couple of approaches. If the watcher process writes comments in HTML
format, and writes them to the same domain as the main blog, then I
can use one of the portable wrappers around XMLHTTPRequest, such as
Dojo, to support a snippet of JavaScript that sources that HTML into
the page. Alternatively the watcher process could write out JSON
(JavaScript Object Notation), which can be sourced into the page
without requiring a heavyweight toolkit. That's how the Recent Links
feature of my blog works now: Del.icio.us provides a JSON
representation of my recent bookmarks at del.icio.us/feeds/json/judell.
-
Propogate deletions. At least for now, I'm leaving comments
open. I'll let the WordPress spam filter catch what it can, and if
anything gets through that shouldn't, I'll manually delete. How the
watcher process will detect deleted comments, in order to refresh
what's included on the main blog, is an open question.
It seems mostly straightforward, but I thought I'd review the plan
here in case anyone's been there and done that and has advice to pass
along.
By the way, I'm not completely comfortable with the idea of
freeloading on WordPress in this way. As I mentioned before,
I'd pay a small monthly fee for a blog-independent service that's
designed equally well for interactive administration of comments and
programmatic integration into my blog. That offer still stands.
Comments
|