CVS commit by brunes: Removed dependancy on lynx M +15 -15 icq_webhandler 1.2 --- kdenonbeta/kopete/protocols/icq_new/icq_webhandler/icq_webhandler #1.1:1.2 @@ -18,29 +18,30 @@ ####################################################################################### +use LWP::Simple; + +my $url = shift; + # Download the file -open(INFILE, "lynx --source $ARGV[0]|"); +$file = get ($url); -# Get the first line -until( $firstLine =~ /\[.*\]/ ) { - $firstLine = ; +# Get the action +if($file =~ /\[(.*)\]/) { + $action = $1; } # Get our variables -while( $line = ) { - - if( $line =~ /UIN=(.*)/ ) { +if( $file =~ /UIN=(.*)\r?\n/ ) { $uin = $1; - } elsif ($line =~ /NickName=(.*)/ ) { +} +if ( $file =~ /NickName=(.*)\r?\n/ ) { $nickName = $1; - } - } # Execute Action -if( $firstLine =~ /\[ICQ User\]/ ) { +if( $action eq "ICQ User" ) { `dcop kopete KopeteIface addContact "ICQ" "$uin" "$nickName"`; -} elsif ($firstLine =~ /\[ICQ Message User\]/ ) { +} elsif ($action eq "ICQ Message User" ) { `dcop kopete KopeteIface addContact "ICQ" "$uin" "$nickName"`;