<?php
require_once __DIR__ . '/EntityFunctions.php';
$ip = isset($_GET['ip']) ? $_GET['ip'] : ($_SERVER['REMOTE_ADDR'] ?? '8.8.8.8');
if ($ip === '::1') {
    $ip = '8.8.8.8';
}
$random_entity_id = bin2hex(random_bytes(32));
$quote = KarmaGetRandomQuote();
$visitorInfo = EntityInfo($ip);

$userAgent = $visitorInfo['userAgent'];
$time      = $visitorInfo['time'];
$country   = $visitorInfo['visitorCountry'];
$city      = $visitorInfo['location']['city'];
$region    = $visitorInfo['location']['region'];
$latitude  = $visitorInfo['location']['latitude'];
$longitude = $visitorInfo['location']['longitude'];
$isp       = $visitorInfo['isp'];
$asn       = $visitorInfo['asn'];
$timezone  = $visitorInfo['timezone']['utc'];
$device    = $visitorInfo['visitorDevice'];
?>
