[gaim-migrate @ 4155]
[pidgin-git.git] / gaim2blt.pl
blobe824cd5b8fe5c16382d3380bc96438e8be21d784
1 #!/usr/bin/perl -w
2 # Original by Andy Harrison,
3 # Rewrite by Decklin Foster,
4 # Available under the GPL.
6 package Gaim2Blt;
7 use strict;
8 use Getopt::Std;
9 use vars qw(%opts $in_group);
11 getopts('s:', \%opts);
12 die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};
14 print <<"EOF";
15 Config {
16 version 1
18 User {
19 screenname "$opts{s}"
21 Buddy {
22 list {
23 EOF
25 while (<>) {
26 chomp;
27 my ($type, $args) = split ' ', $_, 2;
28 next unless $type;
30 if ($type eq 'g') {
31 print " }\n" if ($in_group);
32 print qq( "$args" {\n);
33 $in_group = 1;
34 } elsif ($type eq 'b') {
35 my ($buddy, $alias) = split /:/, $args;
36 print qq( "$buddy"\n);
40 print <<"EOF";
44 EOF