view gaim2blt.pl @ 2349:60c716c32c40

[gaim-migrate @ 2362] (Names changed to protect the innocent.) blue:~/gaim/app/src $ ls -l ~/.gaim/logs/mid.log -rw-r--r-- 1 eric eric 607043 Sep 20 03:28 /home/eric/.gaim/logs/mid.log Previously on my 1.4GHz Athlon, displaying this 600k log file in the Log Viewer took 42 seconds: time start: 1001157353 time end : 1001157395 Now, with the new smiley checker, it takes 23: time start: 1001157199 time end : 1001157222 That's still horrible, but it's only a little more than half the time it previously took. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 22 Sep 2001 11:22:59 +0000
parents 7506587a394d
children 7cd904828d3d
line wrap: on
line source

#!/usr/bin/perl -w
# Original by Andy Harrison,
# Rewrite by Decklin Foster,
# Available under the GPL.

package Gaim2Blt;
use strict;
use Getopt::Std;
use vars qw(%opts $in_group);

getopts('s:', \%opts);
die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};

print <<"EOF";
Config {
  version 1
}
User {
  screenname "$opts{s}"
}
Buddy {
  list {
EOF

while (<>) {
    chomp;
    my ($type, $args) = split ' ', $_, 2;
    next unless $type;

    if ($type eq 'g') {
        print "    }\n" if ($in_group);
        print "    $args {\n";
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF