This commit is contained in:
“wanyongkang”
2022-04-28 17:43:45 +08:00
parent b15188fc6e
commit 0d0572f1ed
4 changed files with 52 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
<?php <?php
function auto_format_list(){ function auto_format_list(){
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22]; $product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22,23];
foreach ($product_list as $product) { foreach ($product_list as $product) {
switch ($product) { switch ($product) {
case 0: case 0:
@@ -52,6 +52,9 @@ function auto_format_list(){
case 22: case 22:
format_product(__DIR__ . '/data/huohu.csv','hhip.vip'); format_product(__DIR__ . '/data/huohu.csv','hhip.vip');
break; break;
case 23:
format_product(__DIR__ . '/data/liebao.csv','lbip.vip');
break;
} }
} }
} }
@@ -111,6 +114,10 @@ function format_all_product($file_path)
case '火狐': case '火狐':
$dns = 'hhip.vip'; $dns = 'hhip.vip';
break; break;
case '猎豹':
$dns = 'lbip.vip';
break;
default: default:
$dns = 'xlip.vip'; $dns = 'xlip.vip';
break; break;
@@ -127,8 +134,6 @@ function format_all_product($file_path)
$data['status'] = $info[8] ?? ''; $data['status'] = $info[8] ?? '';
if ($dns == 'shihui') { if ($dns == 'shihui') {
$data['nasname'] = $info[9] ?? ''; $data['nasname'] = $info[9] ?? '';
} elseif ($dns == 'hhip'){
$data['nasname'] = '1.hhip.vip';
} else { } else {
$ip = explode('.', ($info[9] ?? '')); $ip = explode('.', ($info[9] ?? ''));
if (count($ip) == 4) { if (count($ip) == 4) {

View File

@@ -5,7 +5,7 @@
* @Author: kangkang * @Author: kangkang
* @Date: 2020-11-06 14:32:57 * @Date: 2020-11-06 14:32:57
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-14 17:50:48 * @LastEditTime: 2022-04-28 17:37:42
*/ */
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: *"); header("Access-Control-Allow-Methods: *");
@@ -62,6 +62,10 @@ switch ($id) {
case 22: case 22:
get_product(__DIR__ . '/data/download/huohu.csv'); get_product(__DIR__ . '/data/download/huohu.csv');
break; break;
case 23:
get_product(__DIR__ . '/data/download/liebao.csv');
break;
} }
function get_all_product($file_path) function get_all_product($file_path)

View File

@@ -5,7 +5,7 @@
* @Author: kangkang * @Author: kangkang
* @Date: 2020-11-03 11:04:15 * @Date: 2020-11-03 11:04:15
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-14 18:27:27 * @LastEditTime: 2022-04-28 17:39:37
*/ */
$is_script = 1; $is_script = 1;
include_once __DIR__ . '/../../index.php'; include_once __DIR__ . '/../../index.php';
@@ -13,18 +13,20 @@ include_once __DIR__ . '/auto_format.php';
// //测试用---------------------------------------------------------------------------------------------------------- // //测试用----------------------------------------------------------------------------------------------------------
// $url = 'http://int.linghangadmin.com:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
// $huohu = json_decode(file_get_contents($url), true); $url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
$liebao = json_decode(file_get_contents($url), true);
// if(!empty($huohu)){ if(!empty($liebao)){
// $huohu_f = fopen(__DIR__ . '/data/huohu.csv', 'w'); $liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
// //写入火狐文件 //写入火狐文件
// $huohu_data = get_product(__DIR__ . '/data/huohu.csv'); $liebao_data = get_product(__DIR__ . '/data/liebao.csv');
// huohu_getList($huohu, $huohu_f, $all,$huohu_data); huohu_getList($liebao, $liebao_f, $all,$liebao_data);
// fclose($huohu_f); fclose($liebao_f);
// } }
// die;
die;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//强子迅联特征码 //强子迅联特征码
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r'); $sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
@@ -109,6 +111,21 @@ if(!empty($huohu)){
fclose($huohu_f); fclose($huohu_f);
} }
///动态
$url = 'http://int.linghangsoft.net:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
$liebao = json_decode(file_get_contents($url), true);
if(!empty($liebao)){
$liebao_f = fopen(__DIR__ . '/data/liebao.csv', 'w');
//写入火狐文件
$liebao_data = get_product(__DIR__ . '/data/liebao.csv');
huohu_getList($liebao, $liebao_f, $all,$liebao_data);
fclose($liebao_f);
}
$time = time(); $time = time();
$noce = md5(time()); $noce = md5(time());
@@ -278,7 +295,7 @@ function huohu_getList($data, &$file, &$all, $exit)
$province_record = []; $province_record = [];
foreach ($data as $info){ foreach ($data as $info){
$record = []; $record = [];
$record['name'] = '火狐'; $record['name'] = '猎豹';
//如果存在 不为空 则 //如果存在 不为空 则
if (!in_array( $info['province'], $province_record)) { if (!in_array( $info['province'], $province_record)) {
$record['city'] = $info['province']; $record['city'] = $info['province'];
@@ -302,7 +319,7 @@ function huohu_getList($data, &$file, &$all, $exit)
$list[$key][] = $record; $list[$key][] = $record;
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) { if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
fputcsv($dnx_exit, ['强子', explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]); fputcsv($dnx_exit, ['火狐', explode('.',$record['nasname'])[0], $record['nasname'], date('Y-m-d H:i:s')]);
} }
} }
foreach ($list as $val) { foreach ($list as $val) {

View File

@@ -5,7 +5,7 @@
* @Author: kangkang * @Author: kangkang
* @Date: 2020-11-07 11:13:08 * @Date: 2020-11-07 11:13:08
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-27 16:38:16 * @LastEditTime: 2022-04-28 17:38:25
*/ */
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: *"); header("Access-Control-Allow-Methods: *");
@@ -65,6 +65,10 @@ if($_GET['type'] == 1){
case 22: case 22:
search_product(__DIR__ . '/data/download/huohu.csv','hhip.vip'); search_product(__DIR__ . '/data/download/huohu.csv','hhip.vip');
break; break;
case 23:
search_product(__DIR__ . '/data/download/liebao.csv','lbip.vip');
break;
} }
} }
@@ -132,6 +136,10 @@ function search_all_product($file_path,$search){
case '火狐': case '火狐':
$dns = 'hhip.vip'; $dns = 'hhip.vip';
break; break;
case '猎豹':
$dns = 'lbip.vip';
break;
} }
$data['city'] = $info[1]; $data['city'] = $info[1];