function getData(){
$.getJSON('api.php', function(data) {
$('ul').empty();
/* data will hold the php array as a javascript object */
$.each(data, function(key, val) {
$('ul').append('<li id="' + key + '">' + val.date + ' ' + val.event + ' ' + val.region + ' ' + val.host + ' '+ val.type + ' ' + val.info + '</li>');
});
setTimeout(getData, 5000);
});
}
my $str = '0000000000000000;39999999999;2;NONE;true;526;246;101;100;2;1;;;;;;8;101/100.000.99.99;246/000.000.122.122';
#-------------------------------------------------------------------------------
# Заменили дроби на ;
#-------------------------------------------------------------------------------
$str =~ s!/!;!gx;
#-------------------------------------------------------------------------------
# Получили один большой массив
#-------------------------------------------------------------------------------
my (@arr) = split ';', $str;
#-------------------------------------------------------------------------------
# Получаем дубликаты
#-------------------------------------------------------------------------------
my %seen = ();
my @dup = map { 1==$seen{$_}++ ? $_ : () } @arr;
say Dumper @dup;
{ ftp -inv SERVER << EOF
user USER PASSWORD
cd DIRECTORY
ls -R
bye
EOF
} | sed '/^[d-]/!d;s/^\(.\).*/\1/' | sort | uniq -c | sed 's/-/files/;s/d/directories/'