Ruby/FXRuby Example: ICQ Lite History Browser

[Home] - [Source code] - [Links]
ICQ Lite is an offical, lightweight ICQ client for Windows. Its message history is stored in XML files that can be parsed easily by third-party programs. This program provides a slim GUI for browsing the history of ICQ Lite, most useful on platforms like Linux that are not supported by ICQ Lite.

The ICQ Lite History Browser is written in Ruby. Its GUI is implemented using FXRuby, the Ruby port of the FOX toolkit. The XML parser is REXML, written in pure Ruby. Linux distributions should provide packages for FXRuby and REXML, Debian users install ruby, librexml-ruby and from http://pug.qqx.org/debian/unstable/i386/ the package libfx-ruby (until FXRuby is officially part of the Debian distribution). Building from source is pretty simple when using raainstall, check FXRuby's install guide.

Download: icqlitehistorybrowser-0.6.1.tar.gz (7k) (changelog)
(older releases)

Installation (Linux):
tar xvfz icqlitehistorybrowser-0.6.1.tar.gz
cd icqlitehistorybrowser-0.6.1
ruby icqlite-history.rb
  (or ./icqlite-history.rb)
Notes:
  • On the first startup of the script, you will be asked to pick your ICQ Lite history directory. ICQ Lite usually stores its history files under the user's Windows home directory, like \Documents and Settings\<User name>\ Application Data\ICQLite\HistoryDB\<UIN>. The history directory contains a subdirectory for each user on your contact list that has sent or received messages.
  • The UIN resolver that assigns ICQ nicknames to UINs is a hack, and therefore may cease to work randomly or not work at all. It loads the user's homepage on icq.com, and extracts the nickname from the webpage (using a regular expression). So, when the layout changes, this method breaks. Another reason it does not work reliably is that icq.com prevents a client from accessing many pages in a short interval (say, more than ten sites in thirty seconds). So, if "Resolve now" terminates before all UINs have been resolved, wait a minute, then try again. Sorry, but it is a *lot* easier to parse websites than to use the proprietary ICQ protocol, because the latter is not-so-well documented and changes often. On the positive side, you have to do this only once, because the nicks are cached (at least until you select a new history directory).
  • When the internet connection is slow, resolving UINs may block the application for a long time, although the resolver runs in a separate Ruby thread. I guess the creation of the HTTP connection does not return before the connection is established, thus blocking the whole program.
  • The configuration is stored in a FOX registry file, usually under ~/.foxrc/dlicht/ICQLite-History. Delete this file to reset all nicknames (and the history directory) and the window size.
  • Tested with Ruby 1.6 and Ruby 1.8, using FXRuby 1.0.24 and 1.0.27.
© 2003 Daniel Lichtenberger [personal homepage] | #35274