view gaim2blt.pl @ 9923:248c3f88ce99

[gaim-migrate @ 10815] (14:24:22) datallah: LSchiere2: http://www.butfer.com/gaim-patches/log_filename_escaping.patch deals with creating logs for screennames that have characters that are not valid for filenames (14:25:34) datallah: i may write a conversion script for existing log files (particularly because it will cause all irc and yahoo chats not to be found) (14:25:49) datallah: oh.. not irc chats... only yahoo chats (14:26:10) LSchiere2: can yahoo chats be found now? (14:26:35) datallah: yeah... they all have a ':' in them which is not a valid filename character in win32 (14:26:51) LSchiere2: i see. so they can be found on unix but not on win32 (14:27:51) datallah: LSchiere2: yeah, as far as i know committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 31 Aug 2004 18:28:35 +0000
parents 66bf7ecefedd
children
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 qq(    "$args" {\n);
        $in_group = 1;
    } elsif ($type eq 'b') {
        my ($buddy, $alias) = split /:/, $args;
        print qq(      "$buddy"\n);
    }
}

print <<"EOF";
    }
  }
}
EOF