October 2003 Archives

Haloscan comments imported!

| 2 Comments

I finally figured how to get the Haloscan comments from my old Radio Userland weblog imported into Movable Type without screwing up my weblog. I knew there was a plugin available that's supposed to be able to do this, but since all of my post numbers changed in the migration to MT, I didn't see how the plugin would know what comment belonged to what post. The fact that the plugin is listed as a 0.1 beta didn't inspire any confidence either. This is the process I ended up using:

  • Copied comment data from Haloscan website, one comment at a time, field by field, into MS Access database table.

  • Wrote and ran Radio macro to dump list of old post numbers and post date/times.

  • Imported Radio list into Excel, inserted new column and filled it with new MT post numbers, then imported Excel list into second MS Access database table. Linked both MS Access tables with a query.

  • Wrote MS Access VB macro to read query records and output text file suitable for import by MT.

  • Exported a backup copy of the MT mySQL database (in case something went horribly wrong during import).

  • Uploaded the text file, imported it into MT, then rebuilt entire weblog.

61 old comments have been successfully imported and added to the MT weblog.

Radio Userland has a feature called "Stories" which allows you to write items outside the normal chronological flow of posts. I had a few "Stories" in my old Radio Userland weblog that I hadn't migrated over to Movable Type, mainly because I was not sure what the best way was to do that.

Initially, it seemed like the only way I could incorporate my stories into MT was to create a separate index template for each story. This would be okay if I planned on never having more than a few stories, but it would quickly become unmanageable as the number of stories increased.

Then I read Brad Choate's post, "Doing your whole site with MT". This method is *much* better than creating separate index templates for every story. Using the steps in his post as a guide, this is what I did on my blog:

1. Created a new Movable Type blog and named it "bradchoate.com: Static Content".

I created a new MT blog and named it "The Tweezer's Edge: Stories" - it seemed to fit better with what I was going to use it for.

2. Deleted all the Index templates.

This seemed really unusual until I fully understood how everything worked. I did initially delete all of the index templates, but ended up adding a main index template afterwards to display an index of story (entry) titles.

3. Deleted all the archive templates, except for the Individual archive template.

I followed this step exactly.

4. Made sure individual archives were enabled.

I followed this step as well.

5. Made the archive path the root directory of my web site.

By doing this, you can then direct MT to create the story html files anywhere in your weblog. I wanted my stories to all be placed under my "archives" directory, so I made the archive path the same as my main weblog.

6. Created categories for each directory I want to create content for (category name = directory name).

I did not want to use categories for my stories, so I did not perform this step.

7. Used the following for the Individual Entry Archive filename template (specified on the "Archiving" page of your weblog configuration). Produces: "category/entry_title.html":

<$MTEntryCategory lower_case="1"$><MTIfNotEmpty var="EntryCategory">/</MTIfNotEmpty><$MTEntryTitle dirify="1"$>.html

Since I did not intend to use categories, all I needed for the file name template was "stories/entry_title.html", so this is the archive filename template I used:
stories/<$MTEntryTitle dirify="1"$>.html

With this setup, each entry in this weblog becomes its own separate page without the need for separate templates.

As I noted in step 2, I did add an index template to display a list of story (entry) titles. The only issue I had with my story index template was that I wanted to include some template modules from my main blog, but MT does not provide a way for one weblog to access modules in another weblog. Then I discovered the OtherBlog plugin, which allowed me to do exactly that.

This is really a slick way to handle "stories" and other static content. I've now finally migrated my stories into MT. In my links column (under "Navigation"), my About Me page is a story, and my index of stories can be viewed by clicking on the Stories Index link.

Blog Housekeeping

Over the last few days, I've been cleaning up some things left over from my migration to Movable Type. A lot of it has been driven the desire to eliminate as many of the 404 errors showing up in my server logs. Some of the things I've done:

  • Added a robots.txt file to my web site. It's a pretty simple file - bots are disallowed from all directories except / and /archives.

  • Added a custom 404.shtml error page. My web host allows me to also create custom error pages for 400 (Bad request), 401 (Authorization required), 403 (Forbidden), and 500 (Internal server error), but since I haven't seen any of these errors yet in the logs, there doesn't seem to be an urgent need to create them.

  • Fixed and added some redirects to my .htaccess file to cut down on 404 errors that were still occurring even after they had been redirected to my new domain.

  • Went through all of my posts to fix internal links to posts and images so they now point at the right path. I also changed the internal links to use relative paths in the hope that any future moves will be less of a hassle in this regard.

  • Tweaked my category pages so they now have the same layout as my index pages (blogroll, logos, etc.).

  • Used CPanel's "Index Manager" to disable listing of directories on the webserver other than /, /archives, /gems, and /images.

  • Migrated my Radio Userland "Stories" into Movable Type. (How I did this will be described in my next post.) Added more redirects to my .htaccess file so requests to view these pages no longer return 404 errors.

One last thing that I thought I wanted to do was to import my comments from HaloScan. I'm not sure any more this would be worth the effort that would be involved.

RSS Feed for Trackbacks

| 1 TrackBack

After creating an RSS feed for new comments, I decided to create an RSS feed for trackback pings as well. Using my RSS comments feed as a basis, I wrote the following template for trackbacks:

<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<rss version="2.0">
  <channel>
    <title><$MTBlogName remove_html="1" encode_html="1"$>: Trackback</title>
    <link><$MTBlogURL$></link>
    <description>Latest trackbacks for <$MTBlogName remove_html="1" encode_html="1"$></description>
    <language>en-us</language>
    <lastBuildDate><MTPings lastn="1"><$MTPingDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></MTPings></lastBuildDate>
    <generator>http://www.movabletype.org/?v=<$MTVersion$></generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
<MTPings lastn="20" sort_order="descend">
    <item>
      <title>Trackback: &quot;<$MTPingTitle remove_html="1" encode_html="1"$>&quot;</title>
      <link><$MTPingURL$></link>
      <description>&lt;strong&gt;Excerpt:&lt;/strong&gt; <$MTPingExcerpt remove_html="1" encode_html="1"$>&lt;br /&gt;
      &lt;strong&gt;Weblog:&lt;/strong&gt; <$MTPingBlogName remove_html="1" encode_html="1"$>&lt;br /&gt;
      &lt;strong&gt;Tracked:&lt;/strong&gt; <$MTPingDate language="en" format="%B %d, %Y %I:%M %p"$></description>
      <guid isPermaLink="false">tbping<$MTPingID zero_pad="6"$>@<$MTBlogURL$></guid>
      <pubDate><$MTPingDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></pubDate>
    </item>
</MTPings>
  </channel>
</rss>

If you would like to use this template to create your own trackback RSS feed: Create a new index template, give it an output file name like "trackbacks.xml", and copy the above code into the template. Save the template then rebuild.

Update 13-May-2004: RSS Trackback Feed template updated:

  • encode_xml attributes replaced with encode_html attributes
  • remove_html and encode_html attributes added to MTBlogName tags in channel title and description elements
  • language="en" attribute added to date tags
  • lastBuildDate element changed from date of rebuild to date of last trackback
  • pubDate element added - shows last rebuild date
  • Text of generator element changed
  • docs element added
  • remove_html attribute added to MTPingTitle, MTPingExcerpt, and MTPingBlogName tags in item description element
  • <b> tags replaced with <strong> tags in item description element

Update 10-Jun-2004: RSS Trackback Feed template updated again:

  • pubDate element removed from <channel> - rebuilding feed shouldn't make feed appear changed unless something really has
  • ttl element removed - not necessary

RSS Feed for Comments

| 9 Comments | 8 TrackBacks

I've created an RSS feed for my comments so I could view new comments in my news reader. To figure out how to what needed to be in the template, I looked at sample RSS comments templates from Phil Ringnalda and Adam Kalsey, my old RSS comment feeds from HaloScan and Radio Userland, and a copy of the RSS 2.0 specification.

This is the template I came up with:

<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<rss version="2.0">
  <channel>
    <title><$MTBlogName remove_html="1" encode_html="1"$>: Comments</title>
    <link><$MTBlogURL$></link>
    <description>Latest comments for <$MTBlogName remove_html="1" encode_html="1"$></description>
    <language>en-us</language>
    <lastBuildDate><MTComments lastn="1"><$MTCommentDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></MTComments></lastBuildDate>
    <generator>http://www.movabletype.org/?v=<$MTVersion$></generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
<MTComments lastn="20" sort_order="descend">
    <item>
      <title>Comment on ><MTCommentEntry><$MTEntryTitle remove_html="1" encode_html="1"$></MTCommentEntry>></title>
      <link><MTCommentEntry><$MTEntryPermalink$>#comments</MTCommentEntry></link>
      <description><$MTCommentBody encode_html="1"$>
        &lt;p&gt;- <$MTCommentAuthorLink show_email="0" encode_html="1"$>&lt;/p&gt;</description>
      <guid isPermaLink="false">comment<$MTCommentID pad="1"$>@<$MTBlogURL$></guid>
      <pubDate><$MTCommentDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></pubDate>
    </item>
</MTComments>
  </channel>
</rss>

If you would like to use this template to create your own comments RSS feed: Create a new index template, give it an output file name like "comments.xml", and copy the above code into the template. Save the template then rebuild.

Update 13-May-2004: RSS Comment Feed template updated:

  • encode_xml attributes replaced with encode_html attributes
  • remove_html and encode_html attributes added to MTBlogName tags in channel title and description elements
  • language="en" attribute added to date tags
  • lastBuildDate element changed from date of rebuild to date of last comment
  • pubDate element added - shows last rebuild date
  • Text of generator element changed
  • docs element added
  • Within item link element, MTEntryLink tag changed to MTEntryPermalink tag
  • Within item description element, MTCommentAuthor tag replaced with MTCommentAuthorLink tag, and added show_email="0" to suppress e-mail addresses in feed

Update 10-Jun-2004: RSS Comment Feed template updated again:

  • pubDate element removed from <channel> - rebuilding feed shouldn't make feed appear changed unless something really has
  • ttl element removed - not necessary

After migrating my weblog from Radio Userland to Movable Type, I searched for a way to create category archive pages as a list of post titles which link to the individual archives, displaying a header for each month/year. (I will refer to these pages as "post index" pages.)

Creating such a post index is not as easy as it would appear, even for the main weblog. In order to display month/year headings, monthly archives must be enabled, even if you don't want them or use them for any other purpose. A separate index template must be created for each category that will have a post index page, because date-based archive template tags (necessary for the monthly headers) cannot be used with category archive template tags. Girlie, a moderator on MT's support forums, posted instructions on how to do this, as well as the template code needed in each category's post index template.

I followed Girlie's instructions, not having any other alternative at the time. I was not satisfied with this answer though, because 1) I had to create and maintain one additional index template for each category (6 so far), and 2) I had to have monthly archives enabled on my weblog, even though I was not using monthly archives for anything else.

I thought it might be possible to use a couple of MT plugins to store a post's month and year in a variable, then check the month and year of subsequent posts to see if it has changed and display a new month / year header when it does. I started looking for plugins that might allow me to do this and stumbled across the EntryList plugin. It is not readily apparent from the plugin's documentation, but one of the plugin's features is exactly the type of sorting, grouping, and headers that I was looking for.

After installing the EntryList plugin, I created a new archive template called "Category Index". Within this template, I used the following template code to create the index of posts with a header for each month / year:

    <MTEntryList>
      <$MTEntryListIncludeAll$>
      <MTEntryListSection name="month">
        <$MTEntryDate format="%Y%m"$>
      </MTEntryListSection>
      <MTEntryListEntries>
        <MTEntryListHeader name="month">
          <b><$MTEntryDate format="%B %Y"$></b><br />
          <ul>
        </MTEntryListHeader>
        <li class="indexListItem">
        <span style="display:block; float:right; padding-left: 20px;"><$MTEntryDate format="%b %d"$></span>
        <a href="<$MTEntryLink archive_type="Individual"$>"><$MTEntryTitle$></a>
        </li>
        <MTEntryListFooter name="month">
         </ul>
        </MTEntryListFooter>
      </MTEntryListEntries>
    </MTEntryList>

The above code will generate a separate post index with month/year headers for each category. Each post is bulleted, and the date of each post will be displayed to the right of the post.

I then added the "Category Index" template to the Category Archives on the Weblog Config | Archiving preferences page, and set the archive file template to "postIndex_<$MTArchiveCategory dirify="1"$>.html" so I did not overwrite my regular category archive pages.

I was then able to delete the 6 custom index templates I had created before to do this, plus disable the monthly archives that I no longer needed. A much better solution, one that I am very satisfied with.

Here's my first post, testing out Movable Type. So far, so good - haven't run into any major problems yet. This could be the beginning of the end for Radio.....

Tasteless CA Recall Humor

David Bernstein at the Volokh Conspiracy says:

I'd Pay to See It: Jess Ventura versus Arnold S., in a steel cage match. Guest Ref: Arianna Huffington.

Add a toilet bowl in the corner to dunk the ref's head in, and I'd pay to see it too!

The Tweezer's Edge has moved!!

The Tweezer's Edge has outgrown its free space on Earthlink and has been migrated to a new domain hosted by LiveRack. Please update your bookmarks, links, RSS feeds, etc., to reflect the new location:

http://tweezersedge.com/

In Radio's discussion forum, Hetty Litjens (Heli's Heaven and Hell Radio) started off a forum thread innocently enough:

"Are there any sound files other than wav that can be upstreamed to Radio cloud? If not, isn't it time this is made possible? Even a limitation to say 1 MB or 1 minute would be a great improvement.

  • Most other blogs, such as iBlog, do have possibilities to upload movies, mp3s etc. without any limitations."*

Four days went by without any response, so Hetty then posts this:

"HELLOOOOOO!!!! Anybody hoooooooooome?"

Lisa (distant, early morning) and I should have known that this was going to be trouble, but we both decided to help out.

If you want to see how far off-topic a thread (currently at 19 posts) can go, leaving logic and common-sense behind, I invite you to read it for yourself. I never thought I would have to flame someone in Radio's forums, but in this case, it is deserved.

Hetty barely comments on the thread in her weblog here.