summary refs log tree commit diff
path: root/workflow.pl
blob: cf2b8e11e4a16a455b11ae16ff84ad9fa01b88e0 (plain) (blame)
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
#!/usr/bin/perl

use Term::ReadKey;

print " .---------------------------------------------.\n";
print " | cpan-explorer.org static content generation |\n";
print " '---------------------------------------------'\n";

echo ""
echo "Step 1 - Downloading database.."
#`./download_sqlite.pl`;

echo ""
echo "Step 2 - Manual spatialization : press any key when svg is ready"
ReadMode 4; # Turn off controls keys
while (not defined ($key = ReadKey(-1)) {
    # No key yet
}
ReadMode 0; # Reset tty mode before exiting


print "\nStep 3 - Generating high-res PNGs..\n";

my $scale = 20000;
my $inputfile = 'packages.svg';
my $outputfile = 'packages.png';
my $rsvgpath = 'rsvg';

die "couldn't find $inputfile" unless -e $inputfile;
`$rsvgpath -x $scale -y $scale $inputfile $outputfile`;

my $inputfile = 'authors.svg';
my $outputfile = 'authors.png';
my $rsvgpath = 'rsvg';

die "couldn't find $inputfile" unless -e $inputfile;
`$rsvgpath -x $scale -y $scale $inputfile $outputfile`;

print "\nStep 4 - Generating tiles..\n";
`./generate_tiles.pl';