Migrating from Trillian Pro
My Mods...
For anybody who found this via google like i did:mbrtis wrote:Hi pheller,
About 2 years after your generous post I'm just now making the switch from Windows to Mac. I've got years of Trillian chat history that I want to move over to Adium, is it possible you could update your perl script to write into Adium's current XMLLogFormat?
Thanks.
There's no need to go to the XMLLog Format, the Adium Log Viewer in 1.x reads both the older .AdiumHTMLLog, .chatlog format that this script produces, and the new XML style. The older .chatlog and .AdiumHTMLLog are actually much easier to define and write based on the information trillian logs by default. Adium actually logs a lot more if you look at the raw XML logs. I had to make a couple of small changes, namely forcing the script to create the directory to the file before it tries to open it (otherwise the open would fail) and modifying the regular expression that parses the date/timestamp on each message, since 3-4 years ago i was an idiot and customized my Trillian logs so they were easier for me to read *then*. I've attached what my script looks like now:
It accepts more than the default style of logging now.
Code: Select all
#!/usr/bin/perl
use File::Basename;
use Date::Manip;
use IO::File;
use strict;
my $adiumlogdir = ".";
foreach my $file (@ARGV) {
my $theirbuddyname = basename($file);
$theirbuddyname =~ s/\.log$//;
$theirbuddyname = lc($theirbuddyname);
my $me;
my $them;
my $oh;
my @data = `cat '$file'`;
foreach my $line (@data) {
my $entry;
$line =~ s/[\r|\n]//g;
if ($line =~ /Session Start \((.*):(.*)\): (.*)/) {
$me = $1;
$them = $2;
my $fn = UnixDate(ParseDate($3),"$adiumlogdir/$theirbuddyname/$theirbuddyname\ \(%Y\|%m\|\%d\).AdiumHTMLLog");
print "full: $fn\n";
if (-e $fn) {
print "exists: $fn!\n";
next;
} else {
`mkdir $theirbuddyname`;
undef $oh;
$oh = new IO::File;
$oh->open($fn,"w");
}
} elsif ($line =~ /\d+-\d+\s (\d\d:\d\d:\d\d) (.*): (.*)/) {
my $timestamp = UnixDate(ParseDate($1),"%i:%M:%S %p");
my $from = $2;
my $message = $3;
$entry = "<div ";
if (($from ne $theirbuddyname) && ($from ne $them)) {
$entry .= "class="send">";
} else {
$from = $theirbuddyname;
$entry .= "class="receive">";
}
$entry .= "<span class="timestamp">$timestamp</span> ";
$entry .= "<span class="sender">$from: </span>";
$entry .= "<pre class="message">$message</pre>\n";
}
print $oh $entry;
}
}it was becoming quite annoying have 5 years of trillian logs spread across a dozen zip files. it's nice to have them all in Adium (even if adium hates me for it). The way its going though i kind of wish the Adium viewer supposed reading them from a compressed state
Then again, i'm up to 7500+ transcripts and its only 41MB
I would really love to see this standardized as well. I have 3 years worth of logs on my old machine and I really can't just get rid of them. Is there any progress on changing logs from Trillian over to Adium? I've got logs from AIM, IRC, Yahoo, MSN and IRC(Yes I know Adium doesn't have IRC. Hopefully someday!)
Could someone maybe post detailed instructions? I'd really appreciate it!
Could someone maybe post detailed instructions? I'd really appreciate it!