System sovereignty timeline viewer for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
731 B

<?php
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
http_response_code(405);
die();
}
date_default_timezone_set('UTC');
$date = date("Ymd", mktime(0, 0, 0, 8, 10, 2007) + 86400 * $_POST["index"]);
$fileName = "maps/" . $date . ".png";
if (file_exists(__DIR__ . "/" . $fileName)){
echo $fileName;
} else {
$url = "https://www.verite.space/maps/influence/" . $date . ".png";
$file_headers = @get_headers($url);
if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
http_response_code(404);
die();
} else {
file_put_contents($fileName, fopen($url, 'r'));
echo $fileName;
}
}