-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.pl
executable file
·50 lines (36 loc) · 910 Bytes
/
parser.pl
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
#! /usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
my $sherlock = "sherlock.txt";
my $whatsmyname = "whatsmyname.txt";
my %sites;
my @sites;
my $counter=0;
print("Removing duplicate entries\n");
open (my $fh, '<', $sherlock) or die $!;
while (my $line = <$fh>){
chomp $line;
# Remove www from any adress to avoid confusion
$line =~ s/www.//;
$sites{$line}++ unless $line !~ /https/;
}
close $fh;
open ($fh, '<', $whatsmyname) or die $!;
while (my $line = <$fh>){
chomp $line;
$line =~ s/www.//;
$sites{$line}++ unless $line !~ /https/;
}
close $fh;
print("Removing Error 404 False Positives\n");
@sites = sort keys %sites;
open ($fh, '>', 'unique.txt') or die $!;
foreach (@sites){
my $response = HTTP::Tiny->new->get($_);
if ($response->{success}){
print $fh "$_\n";
}
}
close $fh;
print("New list available at unique.txt\n");