diff --git a/script/linedata/auto_format.php b/script/linedata/auto_format.php index 0d46638..e46104d 100644 --- a/script/linedata/auto_format.php +++ b/script/linedata/auto_format.php @@ -1,7 +1,7 @@ $v){ - $temp = explode('-',$k); - $sp_xl_list[$temp[1]] = $v; -} +// $sp_xl_json = json_decode(substr($sp_xl_code,3),true); +// $sp_xl_list = []; +// foreach($sp_xl_json as $k=>$v){ +// $temp = explode('-',$k); +// $sp_xl_list[$temp[1]] = $v; +// } -$sp_qz_code = file_get_contents(__DIR__ . '/data/qz.txt', 'r'); +// $sp_qz_code = file_get_contents(__DIR__ . '/data/qz.txt', 'r'); -// echo $sp_qz_code; +// // echo $sp_qz_code; -$sp_qz_json = json_decode(substr($sp_qz_code,3),true); -$sp_qz_list = []; -foreach($sp_qz_json as $k=>$v){ - $temp = explode('-',$k); - $sp_qz_list[$temp[1]] = $v; -} +// $sp_qz_json = json_decode(substr($sp_qz_code,3),true); +// $sp_qz_list = []; +// foreach($sp_qz_json as $k=>$v){ +// $temp = explode('-',$k); +// $sp_qz_list[$temp[1]] = $v; +// } //-------------------------------------------- $all = fopen(__DIR__ . '/data/all.csv', 'w'); @@ -74,6 +72,15 @@ if ($jihu) { fclose($jihu_f); } +//极光 +$url = "http://106.119.166.87:18702/api/agent/getList2?apikey=80cf4f64e990b78a9fc5eb"; +$jiguang = json_decode(file_get_contents($url), true)['data']; +if ($jiguang) { + $jiguang_f = fopen(__DIR__ . '/data/jiguang.csv', 'w'); + jiguang_getList($jiguang, $jiguang_f, $all); + fclose($jiguang_f); +} + $apikey = '80cf4f64e990b78a9fc5eb'; $url = "http://rds-api.juip.com/api/index/getList2?apikey=".$apikey; @@ -111,50 +118,50 @@ liebao_getList($liebao, $liebao_f, $all, $liebao_data, '猎豹'); fclose($liebao_f); } -//先锋 -$xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P']; +// //先锋 +// $xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P']; -if($xianfeng){ -$xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv'); -$xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w'); -//写入先锋文件 -xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data); -fclose($xianfeng_f); -} +// if($xianfeng){ +// $xianfeng_data = get_product(__DIR__ . '/data/xianfeng.csv'); +// $xianfeng_f = fopen(__DIR__ . '/data/xianfeng.csv', 'w'); +// //写入先锋文件 +// xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data); +// fclose($xianfeng_f); +// } -$time = time(); -$noce = md5(time()); -$apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e'; -$sign = md5($time.$noce.$apikey); -$url = "http://47.92.116.14:2222/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign; -$qiangzi = json_decode(file_get_contents($url), true)['data']; -if(!empty($qiangzi)){ -$qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv'); -$qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w'); +// $time = time(); +// $noce = md5(time()); +// $apikey = 'a478ad5aa3079bbbef3cd45e2d55d61e'; +// $sign = md5($time.$noce.$apikey); +// $url = "http://47.92.116.14:2222/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign; +// $qiangzi = json_decode(file_get_contents($url), true)['data']; +// if(!empty($qiangzi)){ +// $qiangzi_data = get_product(__DIR__ . '/data/qiangzi.csv'); +// $qiangzi_f = fopen(__DIR__ . '/data/qiangzi.csv', 'w'); -//写入强子文件 -qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data); -fclose($qiangzi_f); -} +// //写入强子文件 +// qiangzi_getList($qiangzi, $qiangzi_f, $all, $qiangzi_data); +// fclose($qiangzi_f); +// } -$time = time(); -$noce = md5(time()); -$apikey = 'osoa917321hdjw'; -$sign = md5($time.$noce.$apikey); -$url = "http://47.92.65.184:2223/api/getNodeList?agentid=admin2&ti=".$time."&nonce=".$noce."&sign=".$sign; -$xunlian = json_decode(file_get_contents($url), true)['data']; -// $xunlian = false; -if ($xunlian){ - $xunlian_data = get_product(__DIR__ . '/data/xunlian.csv'); - $xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w'); - //写入讯连文件 - xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data); - fclose($xunlian_f); -} +// $time = time(); +// $noce = md5(time()); +// $apikey = 'osoa917321hdjw'; +// $sign = md5($time.$noce.$apikey); +// $url = "http://47.92.65.184:2223/api/getNodeList?agentid=admin2&ti=".$time."&nonce=".$noce."&sign=".$sign; +// $xunlian = json_decode(file_get_contents($url), true)['data']; +// // $xunlian = false; +// if ($xunlian){ +// $xunlian_data = get_product(__DIR__ . '/data/xunlian.csv'); +// $xunlian_f = fopen(__DIR__ . '/data/xunlian.csv', 'w'); +// //写入讯连文件 +// xunlian_getList($xunlian, $xunlian_f, $all, $xunlian_data); +// fclose($xunlian_f); +// } ///动态 $url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf'; @@ -169,32 +176,32 @@ if(!empty($yunniu)){ fclose($yunniu_f); } -$xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data']; -if($xigua){ -$xigua_data = get_product(__DIR__ . '/data/xigua.csv'); -$xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w'); -//写入西瓜文件 -jike_getList($xigua, $xigua_f, $all, $xigua_data, false); -fclose($xigua_f); -} +// $xigua = json_decode(file_get_contents("http://api.beikeip.com/serverlistyzip/"), true)['data']; +// if($xigua){ +// $xigua_data = get_product(__DIR__ . '/data/xigua.csv'); +// $xigua_f = fopen(__DIR__ . '/data/xigua.csv', 'w'); +// //写入西瓜文件 +// jike_getList($xigua, $xigua_f, $all, $xigua_data, false); +// fclose($xigua_f); +// } -$tiantian = json_decode(file_get_contents("https://yoyoapi.yoyoip.com/v1/areas?apiid=89&sendtime=" . time() . "&sign=" . md5('apiid=89&sendtime=' . time() . 'NFeK72yYXmPiGR86YeMCBRTWDxXkrQsd')), true)['data']; -if($tiantian){ -$tiantian_data = get_product(__DIR__ . '/data/tiantian.csv'); -$tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w'); -//写入天天文件 -tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天'); -fclose($tiantian_f); -} +// $tiantian = json_decode(file_get_contents("https://yoyoapi.yoyoip.com/v1/areas?apiid=89&sendtime=" . time() . "&sign=" . md5('apiid=89&sendtime=' . time() . 'NFeK72yYXmPiGR86YeMCBRTWDxXkrQsd')), true)['data']; +// if($tiantian){ +// $tiantian_data = get_product(__DIR__ . '/data/tiantian.csv'); +// $tiantian_f = fopen(__DIR__ . '/data/tiantian.csv', 'w'); +// //写入天天文件 +// tiantian_getList($tiantian, $tiantian_f, $all, $tiantian_data, '天天'); +// fclose($tiantian_f); +// } -$jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data']; -if($jike){ -$jike_data = get_product(__DIR__ . '/data/jike.csv'); -$jike_f = fopen(__DIR__ . '/data/jike.csv', 'w'); -//写入极客文件 -jike_getList($jike, $jike_f, $all, $jike_data); -fclose($jike_f); -} +// $jike = json_decode(file_get_contents("http://api.beikeip.com/beikeiplist/"), true)['data']; +// if($jike){ +// $jike_data = get_product(__DIR__ . '/data/jike.csv'); +// $jike_f = fopen(__DIR__ . '/data/jike.csv', 'w'); +// //写入极客文件 +// jike_getList($jike, $jike_f, $all, $jike_data); +// fclose($jike_f); +// } //水滴 @@ -899,6 +906,57 @@ function jihu_getList($data, &$file, &$all ) } +//极光服务器解析规则 +function jiguang_getList($data, &$file, &$all ) +{ + $key = ''; + $list1 = []; + // print_r($data); + + $province_record = []; + + foreach ($data as $info) { + + $record = []; + + $record['name'] = '极光'; + //如果存在 不为空 则 + $city_name = explode('-',$info['city']); + if(empty($info['city'])) { + continue; + } + //如果存在 不为空 则 + if (!in_array( $city_name[0], $province_record)) { + $record['city'] = $city_name[0]; + $province_record[] = $city_name[0]; + $key = $record['city']; + $list1[$key][] = $record; + } + $key = $city_name[0]; + + + $record['city'] = $city_name[1]; + $record['supply'] = $info['yunying']; + + $record['ip'] = $info['ipCount']; + $record['daikuan'] = $info['daikuan']; + $record['onlineuser'] = ''; + $record['maxuser'] = ''; + $record['online'] = $info['status']; + $record['status'] = $info['onlinestatus']; + $record['nasname'] = $info['address']; + $list1[$key][] = $record; + } + foreach ($list1 as $val) { + foreach ($val as $net_data) { + + fputcsv($file, $net_data); + fputcsv($all, $net_data); + } + } + +} + //麒麟服务器解析规则 function qilin_getList($data, &$file, &$all, $exit ) { diff --git a/script/linedata/search.php b/script/linedata/search.php index 38cd81c..ca4be56 100755 --- a/script/linedata/search.php +++ b/script/linedata/search.php @@ -62,6 +62,9 @@ if($_GET['type'] == 1){ case 29: search_product(__DIR__.'/data/download/jihu.csv','jhip.net'); break; + case 3: + search_product(__DIR__.'/data/download/jiguang.csv','jgip.cc'); + break; case 19: search_product(__DIR__.'/data/download/huohu.csv','hhip.vip'); break; @@ -151,6 +154,9 @@ function search_all_product($file_path,$search){ case '极狐': $dns = 'jhip.net'; break; + case '极光': + $dns = 'jgip.cc'; + break; case '火狐静态': $dns = 'hhip.vip'; break;