Google

Tuesday, March 29, 2005

When the Network Behaves Badly

I am picky when it comes to computing. Still, I think that Blogger currently places too many restrictions on users. For example,

  • I'd like to separate how my blog looks (its style) from what it says (its content). But Blogger forbids
    <LINK REL="stylesheet" TYPE="text/css" HREF="foo.css">
    
    Hence, I am stuck with a huge template with embedded CSS.
  • I'd like to use JavaScript in my post. However, it's possible for JavaScript to appear only in the template (within its header section) right now, making it very inconvenient to offer DHTML functionalities (because Blogger doesn't allow SSI either).
  • Blogger's post editor is too primitive for my taste. When the network is mischievous (which is quite often lately), it's absolutely a torture to create/edit a post.

However, Blogger is free and I appreciate how challenging it is to address these limitations. So I shouldn't complain. Instead, I have worked around the last issue using freeware and Blogger's post-via-email feature (it must have been already enabled). I think that my simple implementation might be useful to other frustrated users too.

Tired of network instability, I first use WinHTTrack to mirror my blog on my dependable PC. This step is not strictly necessary though highly recommended because Blogger doesn't offer any feature to backup a blog. Then I create a placeholder file (foo.html) by duplicating any existing post (and stripping away all its JavaScript stuff) and change these lines near its bottom
  <div class="post-body">
    <p><$BlogItemBody$></p>
  </div>

to
  <div class="post-body">
    <p><object type="text/html" data="bar.html"></object></p>
  </div>

A skeleton, foo.html thus retains all the layout information, giving it a WYSIWYG capability. Now, I can edit a post in bar.html with the much superior (my default) editor XEmacs and locally preview the post in (conveniently bookmarked) foo.html using Firefox. When I finish writing, I open Thunderbird in which I have created a template to email Blogger. The template automatically addresses a recipient (author@blogger.com). All I need to do is to fill in the "Subject:" field with a post title (e.g., "When the Network Behaves Badly"), load bar.html in the message body, and click "Send". That's it.

Since I am an avid cygwin user, I can take full advantage of CLI to further simplify the above process (i.e., less keystrokes). For example, I use cron and httrack to schedule a mirror job every night. On a Linux desktop, I can also alias most of the line below
mail author@blogger.com < bar.html -s "When the Network Behaves Badly"
Of course, XEmacs can do it all for a Lisp expert.

2 Comments:

Anonymous Anonymous said...

It turned out that the network misbehaved earlier because Blogger was downgrading an upgrade.

9:08 PM  
Blogger TX said...

I cannot resist writing a Perl script to simulate SSI instead of the embedded HTML object approach. So after editing, I now run the script to produce a well-formed HTML file for preview.

7:18 AM  

Post a Comment

<< Home