Welcome folks today in this post we will be building a bulk website alexa rank
checker script in perl
language using sitescorechecker
api. All the source code of the application is given below.
Get Started
In order to get started you need to create an app.pl
file inside the root directory of your project and copy paste the code as shown below
app.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 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 |
use threads; use threads::shared; use LWP::Simple; use URI::URL; use LWP::UserAgent; use Parallel::ForkManager; use HTTP::Request::Common; use HTTP::Request::Common qw(GET); use HTTP::Request; use HTML::TreeBuilder; $Logo=" @@@@@@ @@@ @@@@@@@@ @@@ @@@ @@@@@@ @@@@@@@@ @@@ @@@@@@@@ @@@ @@@ @@@@@@@@ @@! @@@ @@! @@! @@! !@@ @@! @@@ !@! @!@ !@! !@! !@! @!! !@! @!@ @!@!@!@! @!! @!!!:! !@@!@! @!@!@!@! !!!@!!!! !!! !!!!!: @!!! !!!@!!!! !!: !!! !!: !!: !: :!! !!: !!! :!: !:! :!: :!: :!: !:! :!: !:! :: ::: :: :::: :: :::: :: ::: :: ::: : : : : :: : : : :: :: : :: : : : Rank Checker By MrAbdelaziz link:https://github.com/MrAbdelaziz/Alexa-Rank-Checker \n\n"; print $Logo; print "List Of Domains -> "; my $Hosts = <STDIN>; chomp($Hosts); open (DFILE, "<$Hosts") || die "[-] Can't Found ($Hosts) !"; my @Hosts = <DFILE>; close DFILE; print "start checking ...\n"; my $pm = new Parallel::ForkManager(10); foreach $host (@Hosts) { my $pid = $pm->start and next; alexa(); $pm->finish; } $pm->wait_all_children(); sub alexa($host) { chomp $host; my $ua = LWP::UserAgent->new( ssl_opts => {verify_hostname => 0,} ); $response = $ua->post('https://sitescorechecker.com/alexa-rank-checker/output',{ url => $host , submit => "Submit"}); my $t = HTML::TreeBuilder->new_from_content($response->content); my ($table) = $t->look_down(_tag => q{table}); my @rows = $table->look_down(_tag => q{tr}); print "domain :".$host."\n"; open(SAVE,">>data.txt"); print SAVE $host."\n"; close(SAVE); for my $row (@rows) { print $row->as_text."\n"; open(SAVE,">>data.txt"); print SAVE $row->as_text."\n"; } print SAVE "--------------------------------------\n"; close(SAVE); threads->exit(); next; } |
Now you can run the perl
script by typing the below command as shown below
perl app.pl
After executing this command this will show the alexa
global rank and country rank