This program converts history files produced by CenterIM into "Unified Log Format" XML files used by Adium and some other instant messaging programs. It can be run manually on a single history file, or can use environment variables to easily batch-process an entire .centerim folder at once.
The Unified Log Format is a standard, based on XML, allowing for the interchange of instant messaging logs between various client programs. The current canonical implementation is in the Mac OS X client Adium (http://www.adiumx.com/). More information on the format can be found at http://trac.adiumx.com/wiki/XMLLogFormat, and there is a low-traffic mailing list at http://groups.google.com/group/ulf-discuss.
CenterIM uses a flat-file log format, with messages delimited with ASCII form-feed characters and timestamps expressed as Unix-style seconds since the epoch.
In the most basic case, the utility can be invoked:
java -cp ":argv.jar:xmlwriter-2.2.2.jar" CIMtoXML \
-i inputfile -d destdir -n localnickname
Online help for all commandline options and switches can be obtained via:
java -cp ":argv.jar:xmlwriter-2.2.2.jar" CIMtoXML -h
The input file, preceded by the -i
flag, must be a CenterIM history
file,
located in the normal ~/.centerim/
hierarchy. History files located
outside of the normal folder hierarchy cannot be processed, because key
information is retrieved from the name of the enclosing directory.
The destination directory, preceded by -d
, is the destination
directory where converted logs should be written. The output file
names will be generated automatically.
Known Bug: Neither the input file nor the destination directory should
contain path separator characters such as /
(Linux) or \\
(Windows), even if those characters are escaped on the command line.
The local nickname, preceded by -n
, is your nick, screen name, or ID
for the messaging system in use. The other user's screen name can be
retrieved from the log file's enclosing folder, but the local name
cannot and must be provided. Examples would be "[email protected]" for
a GTalk account, or "Joe123" for an AIM account. This value will be
used when writing the logs. This parameter is not required if the
--getenv
flag and corresponding environment variables are used.
Required parameters:
-i Source 'history' file (Always required)
-d Destination directory (Always required)
-n Local instant messaging nickname/ID (Required unless --getenv is used)
Optional parameters:
--help Print usage notes and exit
--chatlog Write Adium-style ".chatlog" extension instead of ".xml"
--getenv Use environment variables instead of -n option
--nounixdate Don't add "unixdate" attribute to messages
When used with the --getenv
option, the local nickname is read from one
of three environment variables, which should be set in advance of
program execution:
AIMUSER
MSNUSER
JABBERUSER
The program will choose the appropriate value based on the leading
character in the log file's enclosing folder. Currently, only AIM,
MSN, and Jabber/GTalk networks are supported. This option is provided
so the progam can be more easily called by scripts, for batch
processing of an entire .centerim
directory.
An error will result if a log is processed with the --getenv
option
and the appropriate environment variable has not been set. To prevent
errors, it is recommended that wrapper scripts set all three environment
variables at runtime.
Note: The --getenv
option requires JRE version 1.5 or later, and will
probably fail messily with older versions. JRE 1.5 is also
referred to by Sun as "Java 2 SE 5" or "J2SE 5.0" and can be
downloaded at http://java.sun.com/j2se/1.5/index.jsp. On the
Macintosh platform, the JRE can be most easily updated via the
built-in Software Update utility.
The --chatlog
option changes output files from the default .xml
to
the format used by Adium, .chatlog
. (This is not used by the newest
versions of Adium, which encapsulate .xml
files in per-logfile
directories. However, .chatlog
files will still be associated with
Adium.)
The --nounixdate
option suppresses the non-standard (but typically
not harmful) "unixtime" attributes. These attributes are not a part
of the ULF standard, but are included to reduce ambiguity, ensure all
timestamp information from the original CIM logs is retained in the
XML versions, and aid in further conversion. If these attributes are
not desired, the --nounixdate
option will prevent their inclusion,
and include only the ISO-style date.
Although the program has been tested against typical scenarios and use cases,
it should be considered experimental. Although when used correctly there is
very little chance of it causing harm to your stored logs, it is strongly
recommended that you make a backup copy of your ~/.centerim
directory before
proceeding with conversion.
On Linux and other Unix-like systems, a backup can be made by running:
tar -czvf centerim.bkup.tgz ~/.centerim
Although the converter does not read complete logfiles into memory before writing them, it may fail when the log files are extremely large relative to the amount of memory available to the Java virtual machine. If this occurs, either increase the memory available to the JVM or break the log into multiple files (breaking at an ASCII Form Feed character).
Filenames containing spaces, special characters (even when escaped), or remote URLs may cause unexpected behavior. The program has not been tested against them and their use is not recommended.
The program was tested on Debian Linux and Mac OS X systems; it has not been tested on Windows with Cygwin.
This program is licensed and made available to you under the GNU General
Public License (GPL), version 3.0 or later. A text version of this license
is provided in the file LICENSE
, or it can be obtained from
http://www.gnu.org/licenses/gpl.txt.
This program also makes use of the XmlWriter 2.2.2 library (http://sourceforge.net/projects/xml-writer/) and Oliver Goldman's argv library (http://software.charlie-dog.com/argv/argv.html), which are licensed separately and distributed in unmodified form with the program for convenience.
Oliver Goldman's argv library is Copyright (C) 2001 - 2002 by Oliver Goldman.
Redistribution and use in source and binary forms, with or without modification, are permitted.
XmlWriter 2.2.2 is Copyright (c) 2003 by Henri Yandell.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of XmlWriter nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.