diff --git a/calendar/holiday/api.php b/calendar/holiday/api.php index c6f31b7..5027db8 100644 --- a/calendar/holiday/api.php +++ b/calendar/holiday/api.php @@ -7,8 +7,9 @@ $stream_opts = [ ] ]; if($_GET['date'] == null){ - header("Content-type:application/json"); - echo '{"error":"10001"}'; + header('HTTP/1.1 400 Bad Request'); + header('status: 400 Bad Request'); + echo '{"error":"400"}'; }else{ echo @file_get_contents("http://tool.bitefu.net/jiari/?d=".$_GET['date'],false, stream_context_create($stream_opts)); } \ No newline at end of file diff --git a/fah/json/api.php b/fah/json/api.php new file mode 100644 index 0000000..96d4d96 --- /dev/null +++ b/fah/json/api.php @@ -0,0 +1,37 @@ + [ + "verify_peer"=>false, + "verify_peer_name"=>false, + ] +]; +$error = null; +if($_GET['donor'] == null){ + if($_GET['team'] == '*'){ + echo @file_get_contents("http://reverse.ghink.net/fah.php?team=*",false, stream_context_create($stream_opts)); + }else{ + echo @file_get_contents("http://reverse.ghink.net/fah.php?team=".$_GET['team'],false, stream_context_create($stream_opts)); + } +}else{ + if($_GET['team'] == null){ + }else{ + header('HTTP/1.1 400 Bad Request'); + header('status: 400 Bad Request'); + echo '{"error":"400"}'; + } +} +if($_GET['team'] == null){ + if($_GET['donor'] == '*'){ + echo @file_get_contents("http://reverse.ghink.net/fah.php?donor=*",false, stream_context_create($stream_opts)); + }else{ + echo @file_get_contents("http://reverse.ghink.net/fah.php?donor=".$_GET['donor'],false, stream_context_create($stream_opts)); + } +}else{ + if($_GET['donor'] == null){ + }else{ + header('HTTP/1.1 400 Bad Request'); + header('status: 400 Bad Request'); + echo '{"error":"400"}'; + } +} \ No newline at end of file diff --git a/ipinfo/api.php b/ipinfo/api.php index 2bbf2b4..f1de9a0 100644 --- a/ipinfo/api.php +++ b/ipinfo/api.php @@ -1,38 +1,15 @@ array( - 'timeout'=>3, - ) - ); - $context = stream_context_create($opts); - return @file_get_contents("http://whois.pconline.com.cn/ipJson.jsp", false, $context); -} if(empty($_GET['ip'])){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $ip=$_GET['ip']; } -$db=mysqli_connect("database.ghink.net","ghinkapi","ghink2014","ghinkapi"); -mysqli_query($db,"set names utf8"); -$result=mysqli_query($db,"SELECT `ip` FROM `ip_area` WHERE `ip`='".$ip."'"); -if(empty(mysqli_fetch_array($result))){ - if(is_url_alive()){ - $ipinfo=@file_get_contents("http://whois.pconline.com.cn/ipJson.jsp?ip=".$ip."&json=true"); - $ipinfo=iconv("GB2312","UTF-8",$ipinfo); - $ipinfo=json_decode($ipinfo); - foreach($ipinfo as $ii=>$ii2){ - $$ii = $ii2; - } - echo '{"ip":"'.$ip.'","pro":"'.$pro.'","city":"'.$city.'","addr":"'.trim($addr).'"}'; - mysqli_query($db,"INSERT INTO `ip_area` (`ip`, `pro`, `city`, `addr`, `last_update`) VALUES ('".$ip."', '".$pro."', '".$city."', '".trim($addr)."', '".time()."')"); - }else{ - echo '{"error":"10002"}'; - } -}else{ - $result=mysqli_query($db,"SELECT * FROM `ip_area` WHERE `ip`='".$ip."'"); - $result=mysqli_fetch_array($result); - echo '{"ip":"'.$result['ip'].'","pro":"'.$result['pro'].'","city":"'.$result['city'].'","addr":"'.$result['addr'].'"}'; + +$ipinfo=@file_get_contents("http://whois.pconline.com.cn/ipJson.jsp?ip=".$ip."&json=true"); +$ipinfo=iconv("GB2312","UTF-8",$ipinfo); +$ipinfo=json_decode($ipinfo); +foreach($ipinfo as $ii=>$ii2){ + $$ii = $ii2; } -mysqli_close($db); \ No newline at end of file +echo '{"ip":"'.$ip.'","pro":"'.$pro.'","city":"'.$city.'","addr":"'.trim($addr).'"}'; \ No newline at end of file diff --git a/live/bilibili/api.php b/live/bilibili/api.php index e9f8874..5b4fee4 100644 --- a/live/bilibili/api.php +++ b/live/bilibili/api.php @@ -4,7 +4,9 @@ function decodeUnicode($str){ return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', create_function('$matches', 'return iconv("UCS-2BE","UTF-8",pack("H*", $matches[1]));'), $str); } if($_GET['roomid']==null){ - echo '{"error":"10001"}'; + header('HTTP/1.1 400 Bad Request'); + header('status: 400 Bad Request'); + echo '{"error":"400"}'; }else{ $json=@decodeUnicode(@file_get_contents("https://api.live.bilibili.com/xlive/web-room/v1/index/getRoomPlayInfo?room_id=".$_GET['roomid']."&play_url=1&mask=1&qn=0&platform=web")); if($_GET['mode']=="easy"){