attached is my latest script, and buddies.xml, with a few changes that
where recommended from some people on the list, I'm subscribed to the
list now, but i would like to be cced if possible :).

Enjoy!

#!/usr/bin/perl -w

# Trillian to LICQ convertor
# By Peter Revill ([EMAIL PROTECTED])
# HUGE thanks to #Perl on irc.openprojects.net especially carbon :)



use warnings;
use strict;

my $string_data;
my $users = 0;

    my $searchstring;
    my $new_usersconf;

    my ($file_buffer, $file_path, $i, $ans);
    print "To run, copy Buddies.xml from your trillian profile (normally trillian/users/default/Buddies.xml and supply Buddies.xml as the file name)";
    
    print "Please enter a file to read: ";


    $ans = <STDIN>; chomp($ans);

    $file_path = $ans;
    	if(open(FH, $file_path))
	{


	while(<FH>) {


	if(/A(\d+)%/) {

		$users++;



		}
	}

	}
	close(FH);

	open(FHD,$file_path);
	$new_usersconf = "[users] \nNumOfUsers = " . $users . "\n";

	my $count = 1;

	while(<FHD>) {

		if(/A(\d+)%/) {


			$new_usersconf = $new_usersconf . "User" . $count . " = " . $1 . "\n";
			open(USE,"> .licq/users/" . $1 . ".uin");
			print USE "

			[user] \n
History = default\n
Groups.System =\n
Groups.User =\n
Ip =\n
IntIp =\n
Port =\n
NewMessages =\n
LastOnline =\n
LastSent =\n
LastRecv =\n
LastCheckedAR =\n
AutoAccept =\n
StatusToUser =\n
CustomAutoRsp =\n
SendIntIp =\n
UserEncoding =\n
SID =\n
GSID =\n
Alias =\n
FirstName =\n
LastName =\n
Email1 =\n
Email2 =\n
EmailO =\n
City =\n
State =\n
PhoneNumber =\n
FaxNumber =\n
Address =\n
CellularNumber =\n
Zipcode =\n
Country =\n
Timezone =\n
Authorization =\n
HideEmail =\n
Age =\n
Gender =\n
Homepage =\n
BirthYear =\n
BirthMonth =\n
BirthDay =\n
Language1 =\n
Language2 =\n
Language3 =\n
CompanyCity =\n
CompanyState =\n
CompanyPhoneNumber =\n
CompanyFaxNumber =\n
CompanyAddress =\n
CompanyZip =\n
CompanyCountry =\n
CompanyName =\n
CompanyDepartment =\n
CompanyPosition =\n
CompanyHomepage =\n
";
			close(USE);

			$count++;



		}
	}

	# now its time to write to users.conf

	open(USER, "> users.conf");

	print USER $new_usersconf;

	print $new_usersconf;
	
	print "Work complete, to finish off, all you need to do is copy users.conf (which should be in this dir, to .licq/users.conf (use cp users.conf .licq/users.conf if you want) (this assumes you have run this script in your home directory)";

	print "\n Then, go into licq, all the nicknames will come up as unknown, but click Licq: user functions - update all users and walla, problem solved :)";
	print "\n Enjoy! Cheers Peter Revill";
	
	close(USER);
	

		# the first thing we do is split it into a nice array


<?xml version="1.0"?>
   <!DOCTYPE buddies
      PUBLIC "-//IETF//DTD RFCxxxx XBUDDY 1.0//EN" "xbuddy.dtd">

<!-- WARNING: This is a generated file by Trillian.  Do not update while -->
<!--          Trillian is running otherwise updates will be erased       -->

   <buddies>
      <title>Buddies for Trillian User</title>
      <version>1.2</version>
  
         <buddy uri="ICQ:1%3A161269327%3ARaWkUs">RaWkUs</buddy>
         <buddy uri="ICQ:1%3A1643788%3A%7E%A4%ABFoNtS%BB%A4%7E">%7E%A4%ABFoNtS%BB%A4%7E</buddy>
         <buddy uri="ICQ:1%3A2635344%3A2635344">2635344</buddy>
         <buddy uri="ICQ:1%3A48215041%3AShadow">Shadow</buddy>
         <buddy uri="ICQ:1%3A72727525%3Avamps">vamps</buddy>
         <buddy uri="ICQ:1%3A130089170%3ANystr0m">Nystr0m</buddy>
         <buddy uri="ICQ:1%3A13043739%3AJesterhoax">Jesterhoax</buddy>
         <buddy uri="ICQ:1%3A47932127%3A%23DaRkSiTh%23">%23DaRkSiTh%23</buddy>
         <buddy uri="ICQ:1%3A3509107%3ACronox">Cronox</buddy>
         <buddy uri="ICQ:1%3A44856899%3Arigano%2E">rigano%2E</buddy>
         <buddy uri="ICQ:1%3A37260481%3AY2J">Y2J</buddy>
         <buddy uri="ICQ:1%3A79527167%3ATomas">Tomas</buddy>
         <buddy uri="ICQ:1%3A6086448%3ADark_Killa">Dark_Killa</buddy>
         <buddy uri="ICQ:1%3A74155349%3Ax3r0">x3r0</buddy>
         <buddy uri="ICQ:1%3A108161546%3APolythene%20WOL">Polythene%20WOL</buddy>
         <buddy uri="ICQ:1%3A63222932%3ABrodsta">Brodsta</buddy>
         <buddy uri="ICQ:1%3A67285155%3ATha%20Archangel">Tha%20Archangel</buddy>
         <buddy uri="ICQ:1%3A104756055%3AnVe%5BNem%EAsiS%5D">nVe%5BNem%EAsiS%5D</buddy>
         <buddy uri="ICQ:1%3A9501992%3A9501992">9501992</buddy>
         <buddy uri="ICQ:1%3A33722900%3AStatik">Statik</buddy>
   </buddies>

Reply via email to