source: trunk/third/gaim/gaim2blt.pl @ 22057

Revision 22057, 728 bytes checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r22056, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#!/usr/bin/perl -w
2# Original by Andy Harrison,
3# Rewrite by Decklin Foster,
4# Available under the GPL.
5
6package Gaim2Blt;
7use strict;
8use Getopt::Std;
9use vars qw(%opts $in_group);
10
11getopts('s:', \%opts);
12die "usage: $0 -s 'screen name' gaim.buddy\n" unless $opts{s};
13
14print <<"EOF";
15Config {
16  version 1
17}
18User {
19  screenname "$opts{s}"
20}
21Buddy {
22  list {
23EOF
24
25while (<>) {
26    chomp;
27    my ($type, $args) = split ' ', $_, 2;
28    next unless $type;
29
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);
37    }
38}
39
40print <<"EOF";
41    }
42  }
43}
44EOF
Note: See TracBrowser for help on using the repository browser.