Code Kata: Converting old ICQ chat logs to html

Enough about books for a while. Let’s do some coding finger exercise. When I migrated from my Windows XP machine to my MacBook I made a backup of my old ICQ chats. Because I wanted to read what my wife and I chatted about ten years ago I tried to convert the old logs into HTML.

First challenge: Files are not correctly sorted in directory

These files are stored as one XML file per month and conversation.

The naming convention is a bit odd, it reads conversation_1207, which means December 2007.

So let’s rename the files that they will be in correct order.

Second challenge: build a temporary file which contains the whole conversation

Third challenge: convert to HTML

  • Replace unnecessary tags
  • Replace tags with div tags
  • Convert UTC time stamp to readable time stamp
  • Wrap the output with HTML basic page

Fourth challenge: write a CSS file to make it look like a ICQ conversation

tbc

The code on github

Leave a Reply

Your email address will not be published. Required fields are marked *