-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdata.php
43 lines (42 loc) · 1.69 KB
/
data.php
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
42
43
<?php
header('Access-Control-Allow-Origin:*');
function getSubstr($str, $leftStr, $rightStr) {
$left = strpos($str, $leftStr);
$right = strpos($str, $rightStr,$left);
if($left < 0 or $right < $left) return '';
return substr($str, $left + strlen($leftStr), $right-$left-strlen($leftStr));
}
function fsd(){
$fsd = file_get_contents("http://www.sparrowhe.top/whazzup.txt");
$str = getSubstr($fsd,"!CLIENTS","!SERVERS");
$str = trim($str);
$data = explode("\n",$str);
foreach ($data as $key => $value){
$value = trim($value);
$arr = explode(":",$value);
$heading = (($arr[38] & 4092) >> 2) / 1024 * 360 ;
$heading = round($heading);
$radar_radius = 1852 * $arr[19] / 2 ;
if (isset($arr[3])){
echo $arr[3].":".$arr[1].":".$arr[0].":".$arr[4].":".$arr[5].":".$arr[6].":".$arr[7].":".$arr[8].":".$heading.":".$arr[11].":".$arr[13].":".$arr[30].":".$radar_radius.":XNATC:".$arr[17].":".$arr[9];
echo "\n";}
}
}
function fsd1(){
$fsd = file_get_contents("http://www.xiaohangair.com/vam/dataxn.php");
$str = getSubstr($fsd,"!CLIENTS","!SERVERS");
$str = trim($str);
$data = explode("\n",$str);
foreach ($data as $key => $value){
$value = trim($value);
$arr = explode(":",$value);
$heading = (($arr[38] & 4092) >> 2) / 1024 * 360 ;
$heading = $arr[38];
$radar_radius = 1852 * $arr[19] / 2 ;
if (isset($arr[3])){
echo $arr[3].":".$arr[1].":".$arr[0].":".$arr[4].":".$arr[5].":".$arr[6].":".$arr[7].":".$arr[8].":".$arr[8].":".$arr[11].":".$arr[13].":".$arr[30].":".$radar_radius.":XHAir:0001:".$arr[9] ;
echo "\n"; }
}
}
fsd();
fsd1();