mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
bugmenot.com changed their format. Back to the old method of handling it.
This commit is contained in:
parent
9a0bf83756
commit
c3066a4076
@ -135,41 +135,42 @@ B<bugmenot> or B<bn>
|
|||||||
{
|
{
|
||||||
($current_url) = $current_url =~ /^.*:\/\/(.*)/;
|
($current_url) = $current_url =~ /^.*:\/\/(.*)/;
|
||||||
my $bugmenot = 'http://bugmenot.com/view.php?url=' . $current_url;
|
my $bugmenot = 'http://bugmenot.com/view.php?url=' . $current_url;
|
||||||
my $tempfile = $ENV{'HOME'} . '/.elinks/elinks';
|
#my $tempfile = $ENV{'HOME'} . '/.elinks/elinks';
|
||||||
my $matrix = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
#my $matrix = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||||
for (0..int(rand(7) + 9))
|
#for (0..int(rand(7) + 9))
|
||||||
{
|
#{
|
||||||
$tempfile = $tempfile . substr($matrix, (length($matrix) - 1) - rand(length($matrix) + 1), 1);
|
#$tempfile = $tempfile . substr($matrix, (length($matrix) - 1) - rand(length($matrix) + 1), 1);
|
||||||
}
|
#}
|
||||||
my ($message, $login, $password);
|
#my ($message, $login, $password);
|
||||||
system('elinks -no-home -source "' . $bugmenot . '" >' . $tempfile . ' 2>/dev/null');
|
#system('elinks -no-home -source "' . $bugmenot . '" >' . $tempfile . ' 2>/dev/null');
|
||||||
open FILE, "<$tempfile" or return $bugmenot;
|
#open FILE, "<$tempfile" or return $bugmenot;
|
||||||
$message = <FILE>;
|
#$message = <FILE>;
|
||||||
while (<FILE>)
|
#while (<FILE>)
|
||||||
{
|
#{
|
||||||
next unless (m/^<dd>(.*)<br \/>(.*)<\/dd><\/dl>$/);
|
#next unless (m/^<dd>(.*)<br \/>(.*)<\/dd><\/dl>$/);
|
||||||
$login = $1;
|
#$login = $1;
|
||||||
$password = $2;
|
#$password = $2;
|
||||||
}
|
#}
|
||||||
$login =~ s/(^\s*|\n|\s*$)//g if $login;
|
#$login =~ s/(^\s*|\n|\s*$)//g if $login;
|
||||||
$password =~ s/(^\s*|\n|\s*$)//g if $password;
|
#$password =~ s/(^\s*|\n|\s*$)//g if $password;
|
||||||
close FILE;
|
#close FILE;
|
||||||
unlink $tempfile;
|
#unlink $tempfile;
|
||||||
return $bugmenot unless $message =~ /[a-z]+/ and $message !~ /404/;
|
#return $bugmenot unless $message =~ /[a-z]+/ and $message !~ /404/;
|
||||||
unless ($message =~ s/.*(No accounts found\.).*/${1}/)
|
#unless ($message =~ s/.*(No accounts found\.).*/${1}/)
|
||||||
{
|
#{
|
||||||
if ($login and $password)
|
#if ($login and $password)
|
||||||
{
|
#{
|
||||||
$message = "Login: " . $login . "\nPassword: " . $password;
|
#$message = "Login: " . $login . "\nPassword: " . $password;
|
||||||
}
|
#}
|
||||||
else
|
#else
|
||||||
{
|
#{
|
||||||
$message = 'No accounts found';
|
#$message = 'No accounts found';
|
||||||
}
|
#}
|
||||||
}
|
#}
|
||||||
system('elinks -remote "infoBox\(' . $message . ')" >/dev/null 2>&1 &');
|
#system('elinks -remote "infoBox\(' . $message . ')" >/dev/null 2>&1 &');
|
||||||
return $current_url; #FIXME
|
#return $current_url; #FIXME
|
||||||
# return;
|
##return;
|
||||||
|
return $bugmenot . $current_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user