Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 33 lines (24 sloc) 0.762 kB
#!/usr/bin/env perl
use Mojo::JSON;
use Mojo::Template;
my $mt = Mojo::Template->new;
open my $fh, '<', 'results.json' or die "No results.json available";
my $json = do { local $/; <$fh> };
close $fh;
my $results = Mojo::JSON->new->decode($json);
sub sortsub {
($a, $b);
if ($results->{$a}{'test'} == $results->{$b}{'test'}) {
return lc $a cmp lc $b;
}
if ($results->{$a}{'test'} == 0) {
return 1
}
return -1
}
my @list = sort { sortsub @_ } grep { !/^_/ } keys %$results;
my $res = $mt->render_file('template.tt', $results, \@list);
open my $f, '>:encoding(UTF-8)', 'index.html'
or die "Cannot open index.html for writing: $!";
print { $f } $res;
close $f or die "Error while writing index.html: $!";
Jump to Line
Something went wrong with that request. Please try again.