#!/usr/bin/perl -w

use strict;

my $screenname = shift or die "Usage: $0 <screenname> <contacts.xml>\n\n";

print << "EOF";
Config {
  version 1
}
User {
  screenname "$screenname"
}
Buddy {
  list {
    "buddies" {
EOF

while( <> ) {
  last if /\@litech.org\/aim\//;
}
while( <> ) {
  if( /<category>([^\/ ]*)\/?<\/category>/ ) {
    print "\t\"$1\"\n";
  }
  last if /<\/group>/;
}

print << "EOF";
    }
  }
}
EOF

exit 0;

