Posts tagged with subtext - page 2

From Blogger to SubText – Export psuedo BlogML from Blogger

Getting my blog out of and into Subtext was not as easy as I’d hoped…

What is BlogML?

BlogML is an XML format designed to encapsulate a blog, it’s posts, comments and categories. Sounds great for transferring between blogs… Alas while SubText and many other engines support it does not.

A simple category-less BlogML file without comments looks something like this;

<blog root-url="" date-created="2006-04-25T01:02:25" xmlns="" xmlns:xs="">
  <title type="text">damieng</title>
  <sub-title type="text">Random musings from Guernsey</sub-title>
  <author name="Damien Guard" email="">
    <post id="113889650370084235" date-created="2006-04-20T01:53:00" date-modified="2006-04-20T01:53:00" approved="true" post-url="">
    <title type="text">Hello</title>
    <content type="text"><![CDATA[This is a blog post<br />With HTML!]]></content>

Check out the BlogML standard itself for full details although doing so requires registration.****The first thing to do is to enter and change the settings for your blog. Specifically you want to go to Formatting Settings and enter 999 and Posts next to Show. If you have more than 99 posts you might have problems.

Setting options on Blogger

Set the Timestamp Format to 4/25/2006 10:38:00AM (obviously the date will be different, it’s the format we’re after) and set Enable Float Alignment to No.

Go to the Comments section and set the Comments Timestamp Format to the same.

Changing the Blogger template

By changing the template we can get to output something close to BlogML but not quite there.

Paste the following block into the template area but DO NOT hit save.

<?xml version=”1.0” encoding=”<$BlogEncoding$>”?>

<$BlogTitle$> <![CDATA[<$BlogDescription$>]]> <![CDATA[<$BlogItemTitle$>]]> <![CDATA[<$BlogItemBody$>]]> <![CDATA[<$BlogCommentBody$>]]> <![CDATA[<$BlogCommentAuthor$>]]>

Now hit the Preview button and wait. Once complete, view source and save that somewhere. Feel free now to cancel the template change.

Patching up the bad output

The output from this template isn’t BlogML yet but it’s not too far off. Cut out the junk before <?xml and and after </blog> to get one step closer.

Now that just leaves us with three problems.

  1. Date/time formats are incorrect for both posts and comments
  2. Comments have no titles
  3. Comment authors are in <author> tags encoded as a CDATA hyper link instead of user-name and user-url attributes of the <comment> tag

These are all limitations of the Blogger template system but with a short XML parser and writer you should be able to fix them up.


Welcome to my new home

It’s been long overdue but you can thank Blogger for being down for long enough to force me to move my blog to the same host as my web site.

I’ve been wanting categories, track-backs and finer control for some time. I looked at dasBlog, .Text and CommunityServer and rejected each for one reason or another before settling on Subtext. It is far from perfect but it’s the best .NET blogging engine for me right now – yes I know there are some great PHP blog systems out there but I have an aversion to PHP.

You’ll find the links are currently broken because SubText strips the www. portion from URLs but I think I’ve got a patch together that will address that tonight.

I’ll be going through the old posts and making minor textual changes and improving the context of the titles. I’ll try and resist the urge to mess with the actual content though and stick to fixing typo’s, spelling mistakes and bad formatting.

You’ll also notice that there are too many posts on the first page the author names of comments are missing. These will also be addressed “Real Soon Now”.

I’ll be putting up a new style too – got something under wraps for use across the blog and main site… although there’s a possibility the main site will end up as SubText articles. We’ll see.

I’ll also be putting up some information on how I managed to get 100+ posts out of and into SubText. It involves BlogML and a custom template for Blogger.

Stay tuned… and don’t forget to update your bookmarks and RSS feeds.