Last active
September 17, 2022 08:34
-
-
Save olejon/637e329309edb8a1c8d4 to your computer and use it in GitHub Desktop.
LogStream - Stream example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/javascript'); | |
if(empty($_GET['callback'])) | |
{ | |
exit; | |
} | |
$callback = $_GET['callback']; | |
$time = date('Y-m-d H:i:s'); | |
$ip = array('82.134.11.231', '151.101.64.73', '212.58.244.2'); | |
$device = array('Desktop', 'Laptop', 'Tablet', 'Mobile', 'Chromebook'); | |
$os = array('Linux', 'Windows', 'macOS', 'Android', 'iOS', 'iPadOS', 'Chrome OS'); | |
$browser = array('Chrome', 'Firefox', 'Safari', 'Chromium/Edge/Opera'); | |
$page = array('Home', 'Support', 'Category: PC Parts', 'Category: Laptops', 'Shopping Cart', 'Checkout via Google Pay', 'Orders'); | |
shuffle($ip); | |
shuffle($device); | |
shuffle($os); | |
shuffle($browser); | |
shuffle($page); | |
$return = array( | |
'time' => $time, | |
'ip' => $ip[0], | |
'device' => $device[0], | |
'operating system' => $os[0], | |
'browser' => $browser[0], | |
'webshop page' => $page[0] | |
); | |
$return = json_encode(array('stream' => $return)); | |
echo $callback . '(' . $return . ')'; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment