火狐线路
This commit is contained in:
@@ -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];
|
||||
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19,22];
|
||||
foreach ($product_list as $product) {
|
||||
switch ($product) {
|
||||
case 0:
|
||||
@@ -49,6 +49,9 @@ function auto_format_list(){
|
||||
case 19:
|
||||
format_product_huohu(__DIR__ . '/data/huohu.csv');
|
||||
break;
|
||||
case 22:
|
||||
format_product(__DIR__ . '/data/huohu.csv');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,7 +109,7 @@ function format_all_product($file_path)
|
||||
$dns = 'mgip.net';
|
||||
break;
|
||||
case '火狐':
|
||||
$dns = 'hhip';
|
||||
$dns = 'hhip.vip';
|
||||
break;
|
||||
default:
|
||||
$dns = 'xlip.vip';
|
||||
@@ -128,7 +131,11 @@ function format_all_product($file_path)
|
||||
$data['nasname'] = '1.hhip.vip';
|
||||
} else {
|
||||
$ip = explode('.', ($info[9] ?? ''));
|
||||
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0], $dns) . '.' . $dns : '';
|
||||
if (count($ip) == 4) {
|
||||
$data['nasname'] = $info[9];
|
||||
} else {
|
||||
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0], $dns) . '.' . $dns : '';
|
||||
}
|
||||
}
|
||||
fputcsv($file1, $data);
|
||||
}
|
||||
|
||||
@@ -5,20 +5,24 @@
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-03 11:04:15
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2022-02-23 18:15:42
|
||||
* @LastEditTime: 2022-04-14 17:46:14
|
||||
*/
|
||||
$is_script = 1;
|
||||
include_once __DIR__ . '/../../index.php';
|
||||
include_once __DIR__ . '/auto_format.php';
|
||||
|
||||
// //测试用----------------------------------------------------------------------------------------------------------
|
||||
// $laoying = json_decode(file_get_contents("http://diqu.pptp.pro:8070/sapi/getroslist"), true)['list'];
|
||||
// if($laoying){
|
||||
// $laoying_data = get_product(__DIR__ . '/data/laoying.csv');
|
||||
// $laoying_f = fopen(__DIR__ . '/data/laoying.csv', 'w');
|
||||
// //写入老鹰文件
|
||||
// laoying_getList($laoying, $laoying_f, $all, $laoying_data);
|
||||
// fclose($laoying_f);
|
||||
|
||||
// $url = 'http://int.linghangadmin.com:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
|
||||
// $huohu = json_decode(file_get_contents($url), true);
|
||||
|
||||
|
||||
// if(!empty($huohu)){
|
||||
// $huohu_f = fopen(__DIR__ . '/data/huohu.csv', 'w');
|
||||
// //写入火狐文件
|
||||
// $huohu_data = get_product(__DIR__ . '/data/huohu.csv');
|
||||
// huohu_getList($huohu, $huohu_f, $all,$huohu_data);
|
||||
// fclose($huohu_f);
|
||||
// }
|
||||
// die;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -93,23 +97,15 @@ if ($xunlian){
|
||||
fclose($xunlian_f);
|
||||
}
|
||||
|
||||
$url = 'http://106.52.152.33:8899/panel/index';
|
||||
$header = array();
|
||||
$header[] = "Cookie: PHPSESSID=4c0teagu80klg065dk4ho0nvu6";
|
||||
$content = linkcurl($url,'POST',[],$header);
|
||||
//获取所有大分类
|
||||
preg_match_all("/<tr(.*?)<\/tr>/is", $content, $result);
|
||||
//获取城市数据
|
||||
// preg_match_all("/<td id=\"pools\">(.*?)<a/is", $result[1][2], $city);
|
||||
//根据省份获取数据
|
||||
preg_match_all("/<span class=\"province(.*?)<hr>/is", $result[1][2], $city);
|
||||
$url = 'http://int.linghangadmin.com:8000/sysadmin/useradmin/lineapi_admin1.php?secretId=108006113&secretKey=87085a351a64c116df09ebc07d5781sf';
|
||||
$huohu = json_decode(file_get_contents($url), true);
|
||||
|
||||
$huohu = $city[1];
|
||||
|
||||
if(!empty($huohu)){
|
||||
$huohu_f = fopen(__DIR__ . '/data/huohu.csv', 'w');
|
||||
//写入火狐文件
|
||||
huohu_getList($huohu, $huohu_f, $all);
|
||||
$huohu_data = get_product(__DIR__ . '/data/huohu.csv');
|
||||
huohu_getList($huohu, $huohu_f, $all,$huohu_data);
|
||||
fclose($huohu_f);
|
||||
}
|
||||
|
||||
@@ -272,36 +268,41 @@ function qiangzi_getList($data, &$file, &$all, $exit)
|
||||
}
|
||||
|
||||
//火狐服务器解析规则
|
||||
function huohu_getList($data, &$file, &$all)
|
||||
function huohu_getList($data, &$file, &$all, $exit)
|
||||
{
|
||||
|
||||
global $dnx_exit, $dnx_has_exit;
|
||||
$online = ['故障', '正常','故障'];
|
||||
$list = [];
|
||||
|
||||
$province_record = [];
|
||||
foreach ($data as $info){
|
||||
$record = [];
|
||||
$record['name'] = '火狐';
|
||||
//匹配所有的省份
|
||||
preg_match("/\'\);\">(.*?)<\/span>/is", $info, $province);
|
||||
$city = $province[1];
|
||||
$record['city'] = $city;
|
||||
$key = $record['city'];
|
||||
$list[$key][] = $record;
|
||||
//匹配所有的城市
|
||||
preg_match_all("/<\/span><span >(.*?)<\/span><\/span>/is", $info, $citys);
|
||||
//每一个城市再解析获取城市和剩余数量
|
||||
foreach ($citys[1] as $city_line){
|
||||
preg_match("/(.*?),剩:/is", $city_line, $address_s);
|
||||
|
||||
$address = $address_s[1];
|
||||
$num = explode('>',$city_line)[1];
|
||||
|
||||
$record['city'] = $address;
|
||||
|
||||
$record['supply'] = $num;
|
||||
|
||||
$record['online'] = '正常';
|
||||
$record['nasname'] = $address;
|
||||
|
||||
//如果存在 不为空 则
|
||||
if (!in_array( $info['province'], $province_record)) {
|
||||
$record['city'] = $info['province'];
|
||||
$province_record[] = $info['province'];
|
||||
$key = $record['city'];
|
||||
$list[$key][] = $record;
|
||||
}
|
||||
//匹配所有的城市
|
||||
//每一个城市再解析获取城市和剩余数量
|
||||
|
||||
$record['city'] = $info['city'];
|
||||
$record['supply'] = $info['displayname'];
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = $online[$info['status']];
|
||||
$record['nasname'] = $info['ip'];
|
||||
|
||||
$list[$key][] = $record;
|
||||
|
||||
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')]);
|
||||
}
|
||||
}
|
||||
foreach ($list as $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
Reference in New Issue
Block a user