Mercurial > pidgin.yaz
annotate gaim2blt.pl @ 1688:85d8c64e969d
[gaim-migrate @ 1698]
linky linky
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 06 Apr 2001 19:10:28 +0000 |
parents | 73be09912842 |
children | 7506587a394d |
rev | line source |
---|---|
1685 | 1 #!/usr/bin/perl |
2 | |
3 ## gaim buddy list to aim blt format converter | |
1686
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
4 my $top = 1; |
1685 | 5 if ($ARGV[0] && $ARGV[1]) { |
6 open (FILE,$ARGV[0]); | |
1686
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
7 print "Config {\n version 1\n}\nUser {\n screename $ARGV[1]\n}\nBuddy {\n list {\n"; |
1685 | 8 foreach $line (<FILE>) { |
9 chomp ($line); | |
10 $line =~ s/^ +//; ## strip any preceding spaces | |
11 next unless $line =~ /^[bg]/; ## Ignore everything but the b and g lines | |
12 @buddy = split(//,$line); ## strip off the first 2 chars of the line. | |
13 shift @buddy; ## crappy way to do it, but I didn't want to | |
14 shift @buddy; ## mess up screen names with spaces in them. | |
15 foreach $char (@buddy) { | |
16 $buddy .= $char; | |
17 } | |
18 @screenname = split(/:/,$buddy); ## split off the aliases | |
19 | |
20 if ($line =~ /^g/) { | |
1686
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
21 print " }\n" unless $top; |
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
22 print " $screenname[0] {\n"; |
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
23 $top = 0; |
1685 | 24 } elsif ($line =~ /^b/) { |
25 print " $screenname[0]\n"; | |
26 } | |
27 $buddy = undef; | |
28 } | |
1686
73be09912842
[gaim-migrate @ 1696]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1685
diff
changeset
|
29 print " }\n }\n}\n"; |
1685 | 30 } else { |
31 print "\n\n\n\tExample:\n\n\t\tgaim2blt.pl gaim.buddy.file YourScreenName\n\n\n\n"; | |
32 } |