gaim2blt.pl

Thu, 05 Apr 2001 02:40:23 +0000

author
Eric Warmenhoven <warmenhoven@yahoo.com>
date
Thu, 05 Apr 2001 02:40:23 +0000
changeset 1685
1b6f74ca62d6
child 1686
98c6b920cd7c
permissions
-rwxr-xr-x

[gaim-migrate @ 1695]
mm. fun stuff

#!/usr/bin/perl 

##  gaim buddy list to aim blt format converter

if ($ARGV[0] && $ARGV[1]) {
	open (FILE,$ARGV[0]);
	print "Config {\n version 1\n}\nUser {\n screename $ARGV[1]\n}\nBuddy {\n list {\n  ";
	foreach $line (<FILE>) {
		chomp ($line);
		$line =~ s/^ +//;			## strip any preceding spaces
		next unless $line =~ /^[bg]/;    	## Ignore everything but the b and g lines
		@buddy = split(//,$line);		## strip off the first 2 chars of the line.
		shift @buddy;				##   crappy way to do it, but I didn't want to
		shift @buddy;				##   mess up screen names with spaces in them.
		foreach $char (@buddy) {
			$buddy .= $char;
		}
		@screenname = split(/:/,$buddy);	## split off the aliases
		
		if ($line =~ /^g/) {
			print "  }\n  $screenname[0] {\n";
		} elsif ($line =~ /^b/) {
			print "   $screenname[0]\n";
		}
	$buddy = undef;
	}
	print "  }\n";
} else {
	print "\n\n\n\tExample:\n\n\t\tgaim2blt.pl gaim.buddy.file YourScreenName\n\n\n\n";
}

mercurial