麒麟线路表

This commit is contained in:
“wanyongkang”
2024-01-15 16:47:30 +08:00
parent b8ee644f8a
commit 90058c3253
5 changed files with 463 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
<?php
function auto_format_list(){
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26];
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23,25,26,27];
foreach ($product_list as $product) {
switch ($product) {
case 0:
@@ -62,6 +62,10 @@ function auto_format_list(){
case 26:
format_product(__DIR__ . '/data/liebao.csv','lbip.cc');
break;
case 27:
format_product(__DIR__ . '/data/qilin.csv','qlip.cc');
break;
}
}
}
@@ -132,6 +136,9 @@ function format_all_product($file_path)
case '猎豹':
$dns = 'lbip.cc';
break;
case 'qilin':
$dns = 'qlip.cc';
break;
default:
$dns = 'xlip.vip';
break;

View File

@@ -73,6 +73,9 @@ switch ($id) {
case 26:
get_product(__DIR__ . '/data/download/liebao.csv');
break;
case 27:
get_product(__DIR__ . '/data/download/qilin.csv');
break;
}
function get_all_product($file_path)

View File

@@ -5,28 +5,30 @@
* @Author: kangkang
* @Date: 2020-11-03 11:04:15
* @LastEditors: “wanyongkang” “937888580@qq.com”
* @LastEditTime: 2024-01-04 15:30:18
* @LastEditTime: 2024-01-15 16:46:41
*/
use extend\jinyouapi\jinyou;
$is_script = 1;
include_once __DIR__ . '/../../index.php';
include_once __DIR__ . '/auto_format.php';
// // //测试用----------------------------------------------------------------------------------------------------------
// $dnx_has_exit = [];
// $qilin = new jinyou;
// //先锋
// $xianfeng = json_decode(file_get_contents("http://service.shenlongip.com/api/server/getlist"), true)['P'];
// $qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
// 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 ($qilin_api_data) {
// $qilin_data = get_product(__DIR__ . '/data/qilin.csv');
// $qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
// qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
// fclose($qilin_f);
// }
// die;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$dnx_has_exit = [];
//强子迅联特征码
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
@@ -152,6 +154,19 @@ xianfeng_getList($xianfeng, $xianfeng_f, $all, $xianfeng_data);
fclose($xianfeng_f);
}
//麒麟动态
$dnx_has_exit = [];
$qilin = new jinyou;
$qilin_api_data = (array)((array)((array)($qilin::getDynamicLine()))['res'])['data'];
if ($qilin_api_data) {
$qilin_data = get_product(__DIR__ . '/data/qilin.csv');
$qilin_f = fopen(__DIR__ . '/data/qilin.csv', 'w');
qilin_getList($qilin_api_data, $qilin_f, $all,$qilin_data);
fclose($qilin_f);
}
// $time = time();
// $noce = md5(time());
@@ -798,6 +813,72 @@ function mogu_getList($data, &$file, &$all )
}
//麒麟服务器解析规则
function qilin_getList($data, &$file, &$all, $exit )
{
global $dnx_exit, $dnx_has_exit;
$key = '';
$list1 = [];
$province_record = [];
foreach ($data as $val) {
$val = (array)$val;
$record = [];
$record['name'] = '麒麟';
$record['city'] = $val['info']->province_name;
$province_record[] = $val['info']->province_name;
$key = $record['city'];
$list1[$key][] = $record;
$record['city'] = $val['info']->province_name.'混拨';
$record['supply'] = '';
$record['ip'] = '';
$record['daikuan'] = '';
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = '正常';
$record['status'] = '';
$record['nasname'] = $val['info']->province_domain;
$list1[$key][] = $record;
foreach($val['line'] as $city_info) {
$city_info = (array)$city_info;
$record['city'] = $city_info['city_name'];
$record['supply'] = $city_info['isp'];
$record['ip'] = '';
$record['daikuan'] = '';
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = $city_info['status'] ? '正常' : '故障';
$record['status'] = '';
$record['nasname'] = $city_info['domain'];
$list1[$key][] = $record;
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
fputcsv($dnx_exit, [$record['name'], explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
}
}
}
foreach ($list1 as $val) {
foreach ($val as $net_data) {
fputcsv($file, $net_data);
fputcsv($all, $net_data);
}
}
}
function laoying_getList($list, &$file, &$all, $exit)
{
global $dnx_exit, $dnx_has_exit;

View File

@@ -5,7 +5,7 @@
* @Author: kangkang
* @Date: 2020-11-07 11:13:08
* @LastEditors: “wanyongkang” “937888580@qq.com”
* @LastEditTime: 2023-05-14 17:33:46
* @LastEditTime: 2024-01-12 10:45:00
*/
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: *");
@@ -75,6 +75,9 @@ if($_GET['type'] == 1){
case 26:
search_product(__DIR__ . '/data/download/liebao.csv','lbip.cc');
break;
case 27:
search_product(__DIR__ . '/data/download/qilin.csv','qlip.cc');
break;
}
}
@@ -154,6 +157,9 @@ function search_all_product($file_path,$search){
case '猎豹':
$dns = 'lbip.cc';
break;
case '麒麟':
$dns = 'qlip.cc';
break;
}
$data['city'] = $info[1];