From c3066a40761218ddff5fe99417b71edb4a59437f Mon Sep 17 00:00:00 2001 From: Russ Rowan Date: Fri, 30 Dec 2005 20:04:48 -0500 Subject: [PATCH] bugmenot.com changed their format. Back to the old method of handling it. --- contrib/perl/hooks.pl | 71 ++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/contrib/perl/hooks.pl b/contrib/perl/hooks.pl index 5edb1811..96dde0f7 100644 --- a/contrib/perl/hooks.pl +++ b/contrib/perl/hooks.pl @@ -135,41 +135,42 @@ B or B { ($current_url) = $current_url =~ /^.*:\/\/(.*)/; my $bugmenot = 'http://bugmenot.com/view.php?url=' . $current_url; - my $tempfile = $ENV{'HOME'} . '/.elinks/elinks'; - my $matrix = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - for (0..int(rand(7) + 9)) - { - $tempfile = $tempfile . substr($matrix, (length($matrix) - 1) - rand(length($matrix) + 1), 1); - } - my ($message, $login, $password); - system('elinks -no-home -source "' . $bugmenot . '" >' . $tempfile . ' 2>/dev/null'); - open FILE, "<$tempfile" or return $bugmenot; - $message = ; - while () - { - next unless (m/^
(.*)
(.*)<\/dd><\/dl>$/); - $login = $1; - $password = $2; - } - $login =~ s/(^\s*|\n|\s*$)//g if $login; - $password =~ s/(^\s*|\n|\s*$)//g if $password; - close FILE; - unlink $tempfile; - return $bugmenot unless $message =~ /[a-z]+/ and $message !~ /404/; - unless ($message =~ s/.*(No accounts found\.).*/${1}/) - { - if ($login and $password) - { - $message = "Login: " . $login . "\nPassword: " . $password; - } - else - { - $message = 'No accounts found'; - } - } - system('elinks -remote "infoBox\(' . $message . ')" >/dev/null 2>&1 &'); - return $current_url; #FIXME -# return; + #my $tempfile = $ENV{'HOME'} . '/.elinks/elinks'; + #my $matrix = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + #for (0..int(rand(7) + 9)) + #{ + #$tempfile = $tempfile . substr($matrix, (length($matrix) - 1) - rand(length($matrix) + 1), 1); + #} + #my ($message, $login, $password); + #system('elinks -no-home -source "' . $bugmenot . '" >' . $tempfile . ' 2>/dev/null'); + #open FILE, "<$tempfile" or return $bugmenot; + #$message = ; + #while () + #{ + #next unless (m/^
(.*)
(.*)<\/dd><\/dl>$/); + #$login = $1; + #$password = $2; + #} + #$login =~ s/(^\s*|\n|\s*$)//g if $login; + #$password =~ s/(^\s*|\n|\s*$)//g if $password; + #close FILE; + #unlink $tempfile; + #return $bugmenot unless $message =~ /[a-z]+/ and $message !~ /404/; + #unless ($message =~ s/.*(No accounts found\.).*/${1}/) + #{ + #if ($login and $password) + #{ + #$message = "Login: " . $login . "\nPassword: " . $password; + #} + #else + #{ + #$message = 'No accounts found'; + #} + #} + #system('elinks -remote "infoBox\(' . $message . ')" >/dev/null 2>&1 &'); + #return $current_url; #FIXME + ##return; + return $bugmenot . $current_url; }