| | #!/usr/bin/env perl |
---|
| | use strict; |
---|
| | use Time::HiRes qw( gettimeofday ); |
---|
| | use CGI; |
---|
| | use DBI; |
---|
| | use GD; |
---|
| | use Geo::IP; |
---|
| | use Geo::Proj4; |
---|
| | |
---|
| | |
---|
| | my ($start_time) = time(); |
---|
| | my ($start_sec, $start_micro) = gettimeofday; |
---|
| | |
---|
| | my ($page); |
---|
| | |
---|
| | my ($dsn) = "DBI:mysql:database=eprintstats;host=localhost"; |
---|
| |
---|
| | $mapimage->string( gdSmallFont, 3, 3, "$types{'download'} downloads", $red ); |
---|
| | $mapimage->string( gdSmallFont, 3, 15, "$types{'abstract'} abstracts", $blue ); |
---|
| | $mapimage->string( gdSmallFont, 3, 27, 'from ' . scalar( keys %cities ) . ' cities', $black ); |
---|
| | $mapimage->string( gdSmallFont, 3, 39, "($num_rows IP addresses)", $black ); |
---|
| | $mapimage->string( gdSmallFont, 3, $height - 15, 'Generated in ' . ( time() - $start_time ) . ' seconds', $black ); |
---|
| | |
---|
| | my ($finish_sec, $finish_micro) = gettimeofday(); |
---|
| | $mapimage->string( gdSmallFont, 3, $height - 15, 'Generated in ' . round( ( $finish_micro - $start_micro ) / 1000 ) . ' ms', $black ); |
---|
| | |
---|
| | binmode(STDOUT); |
---|
| | |
---|
| | print $mapimage->jpeg(); |
---|
| |
---|
|