1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/usr/bin/perl
#CORPORATE BINARY CLEANSER
#Hacked by Andyman
#No guarantees expressed or implied,
#however, it's working for me.
#For Netscape 4.51 (Linux, ELF)
$nscape = "/opt/netscape/netscape";
while($resp ne "y" && $resp ne "n"){
print "Is your Netscape 4.51 binary in /opt/netscape/netscape [y/n]?";
$resp = <STDIN>;
chop($resp);
}
if($resp eq "n"){
do{
print "Location of existing netscape 4.51 binary [/opt/netscape/netscape]: ";
$resp = <STDIN>;
chop($resp);
}
while (length($resp)<2 || ! -e $resp);
$nscape = $resp;
}
$new = ">".$nscape.".new";
while(length($resp) != 31){
print "Now, a *folder* url to replace the links to netscape.com. They all\n";
print "begin with home.netscape.com/bookmark/4_51 Hopefully, you\n";
print "have a homepage someplace you can replace this with. If not,\n";
print "you can hit <enter> to use my substitutes, which will work for you.\n";
print "In order to preserve the functioning of the binary, you can't make\n";
print "your *folder* url longer than this:\n\n";
print "home.netscape.com/bookmark/4_51\n";
$resp = <STDIN>;
chop($resp);
if($resp eq ""){ $resp = "199.105.128.138//////////search";}
else{
if(length($resp)>31) {
print "Too long! ". length($resp) . "\n";
}
else{
$len = 31-length($resp);
while($len > 0){
$resp .= "/";
print $resp, "\n";
$len -=1;
}
}
}
}
$n = "n";
do{
print "What name, 8 letters or less, should appear on the \"My Netscape\" button?\n";
$n = <STDIN>;
chop($n);
}while(length($n)>8);
$len = 8-length($n);
while($len > 0){
$n .= "\ ";
$len -= 1;
}
$name = $n;
print "-------------------------------------------------\n";
print "Creating $nscape.new...\n";
open(NEW, $new);
open(FILE,$nscape);
while($line =<FILE>){
#Use local URL for Search button
$line =~ s/home.netscape.com\/bookmark\/4_51/$resp/g;
#Use local url for N image button
$line =~ s/tnetscape.html/newssites.html/g;
#Remove Netscape from title bar
$line =~ s/Netscape:/\ \ \ \ \ \ \ \ \ /g;
#This was tricky to find -- the instance of Netscape
#that appears on the "My Netscape" button
if($line =~ /toolBar/){
if($line =~ /destinations/){
$left = index($line,'destinations');
$line =~ s/\tNetscape/\t$name/;
}
}
print NEW $line;
}
close(FILE);
close(NEW);;
`chmod uog+x $nscape.new`;
|