[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/kopete/protocols/icq_new/icq_webhandler
From:       Jason Keirstead <jason () keirstead ! org>
Date:       2002-12-31 22:03:30
[Download RAW message or body]

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 = <INFILE>;
+# Get the action
+if($file =~ /\[(.*)\]/) {
+        $action = $1;
 }
 
 # Get our variables
-while( $line = <INFILE> ) {
-
-        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"`;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic