Export resultat in JSON format

master
heuzef 7 years ago
parent ab4534639d
commit 07bb168ade
  1. 19
      defacement_check.pl

@ -2,6 +2,7 @@
use strict;
use XML::Simple;
use Data::Dumper;
use JSON qw(to_json);
# Date
use POSIX qw(strftime);
@ -126,13 +127,23 @@ foreach $file (@files)
}
close(FH);
# print "\033[36mTREATH detected on this site \t\t\t\t=> [" . $somme_total_found . "]\n\n"; # Total
print $somme_total_found; # Total
# print $somme_total_found; # Total
$grand_total_found = $somme_total_found + $grand_total_found;
}
# print "\033[36mGrand Total TREATH detected on ALL website \t\t=> [" . $grand_total_found . "]\n\n"; # Grand Total
# Print just the last binaire results in output file
open(my $out, '>', 'out.txt');
print $out $grand_total_found;
close $out;
# open(my $out, '>', 'out.txt');
# print $out $grand_total_found;
# close $out;
# Print results in JSON
my $out = {
site => $site,
threats => $grand_total_found,
date => $date
};
print to_json($out, { pretty => 1 });

Loading…
Cancel
Save