新产品火狐
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];
|
||||
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19];
|
||||
foreach ($product_list as $product) {
|
||||
switch ($product) {
|
||||
case 0:
|
||||
@@ -46,6 +46,9 @@ function auto_format_list(){
|
||||
case 18:
|
||||
format_product(__DIR__ . '/data/mogu.csv', 'mgip.net');
|
||||
break;
|
||||
case 19:
|
||||
format_product_huohu(__DIR__ . '/data/huohu.csv');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,6 +105,9 @@ function format_all_product($file_path)
|
||||
case '蘑菇':
|
||||
$dns = 'mgip.net';
|
||||
break;
|
||||
case '火狐':
|
||||
$dns = 'hhip';
|
||||
break;
|
||||
default:
|
||||
$dns = 'xlip.vip';
|
||||
break;
|
||||
@@ -116,11 +122,13 @@ function format_all_product($file_path)
|
||||
$data['maxuser'] = $info[6] ?? '';
|
||||
$data['online'] = $info[7] ?? '';
|
||||
$data['status'] = $info[8] ?? '';
|
||||
if ($dns != 'shihui') {
|
||||
if ($dns == 'shihui') {
|
||||
$data['nasname'] = $info[9] ?? '';
|
||||
} elseif ($dns == 'hhip'){
|
||||
$data['nasname'] = '1.hhip.vip';
|
||||
} else {
|
||||
$ip = explode('.', ($info[9] ?? ''));
|
||||
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0], $dns) . '.' . $dns : '';
|
||||
} else {
|
||||
$data['nasname'] = $info[9] ?? '';
|
||||
}
|
||||
fputcsv($file1, $data);
|
||||
}
|
||||
@@ -128,6 +136,44 @@ function format_all_product($file_path)
|
||||
fclose($file1);
|
||||
}
|
||||
|
||||
//火狐
|
||||
function format_product_huohu($file_path)
|
||||
{
|
||||
$list1 = [];
|
||||
$file = fopen($file_path, 'r');
|
||||
$file_path1 = explode('/', $file_path);
|
||||
$file1 = fopen(__DIR__ . '/data/download/' . $file_path1[8], 'w');
|
||||
$record = [];
|
||||
while ($info = fgetcsv($file)) {
|
||||
if (empty($info[4])) {
|
||||
$key = $info[1];
|
||||
}
|
||||
$record['name'] = $info[0];
|
||||
$record['city'] = $info[1]??'';
|
||||
|
||||
$record['supply'] = $info[2]??'';
|
||||
$record['ip'] = '';
|
||||
$record['daikuan'] = '';
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = '正常';
|
||||
$record['status'] = '';
|
||||
|
||||
if(!empty($info[4])){
|
||||
$record['nasname'] = '1.hhip.vip';
|
||||
}
|
||||
$list1[$key][] = $record;
|
||||
}
|
||||
foreach ($list1 as $k => $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
fputcsv($file1, $net_data);
|
||||
}
|
||||
}
|
||||
fclose($file1);
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
function format_product($file_path, $dns = '')
|
||||
{
|
||||
$list1 = [];
|
||||
|
||||
@@ -55,6 +55,9 @@ switch ($id) {
|
||||
case 18:
|
||||
get_product(__DIR__ . '/data/download/mogu.csv');
|
||||
break;
|
||||
case 19:
|
||||
get_product(__DIR__ . '/data/download/huohu.csv');
|
||||
break;
|
||||
}
|
||||
|
||||
function get_all_product($file_path)
|
||||
|
||||
@@ -15,17 +15,30 @@ $product_model = new Product;
|
||||
$product_list = $product_model->field('Id,Token')->fetchAll();
|
||||
|
||||
// // //测试用----------------------------------------------------------------------------------------------------------
|
||||
// $url = 'http://106.52.152.33:8899/panel/index';
|
||||
// $header = array();
|
||||
// $header[] = "Cookie: PHPSESSID=4c0teagu80klg065dk4ho0nvu6";
|
||||
// $content = linkcurl($url,'POST',[],$header);
|
||||
|
||||
// $xianfeng = json_decode(file_get_contents("http://apiserver.pptp.biz/Apiserver/getserver"), true);
|
||||
// print_r($xianfeng);die;
|
||||
// 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);
|
||||
// //获取所有大分类
|
||||
// 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);
|
||||
|
||||
|
||||
// $huohu = $city[1];
|
||||
|
||||
// if(!empty($huohu)){
|
||||
// $huohu_f = fopen(__DIR__ . '/data/huohu.csv', 'w');
|
||||
// //写入火狐文件
|
||||
// huohu_getList($huohu, $huohu_f, $all);
|
||||
// fclose($huohu_f);
|
||||
// }
|
||||
|
||||
|
||||
// die;
|
||||
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//强子迅联特征码
|
||||
$sp_xl_code = file_get_contents(__DIR__ . '/data/xl.txt', 'r');
|
||||
@@ -89,6 +102,27 @@ 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);
|
||||
|
||||
$huohu = $city[1];
|
||||
|
||||
if(!empty($huohu)){
|
||||
$huohu_f = fopen(__DIR__ . '/data/huohu.csv', 'w');
|
||||
//写入火狐文件
|
||||
huohu_getList($huohu, $huohu_f, $all);
|
||||
fclose($huohu_f);
|
||||
}
|
||||
|
||||
|
||||
$time = time();
|
||||
$noce = md5(time());
|
||||
$apikey = 'd50f2b2ffd421efa67df8efb96d5ff6c';
|
||||
@@ -284,6 +318,47 @@ function qiangzi_getList($data, &$file, &$all, $exit)
|
||||
|
||||
}
|
||||
|
||||
//火狐服务器解析规则
|
||||
function huohu_getList($data, &$file, &$all)
|
||||
{
|
||||
$list = [];
|
||||
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;
|
||||
|
||||
$list[$key][] = $record;
|
||||
}
|
||||
}
|
||||
foreach ($list as $val) {
|
||||
foreach ($val as $net_data) {
|
||||
|
||||
fputcsv($file, $net_data);
|
||||
fputcsv($all, $net_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//星星服务器解析
|
||||
function xingxing_getList($data, &$file, &$all, $exit)
|
||||
{
|
||||
@@ -1005,10 +1080,6 @@ function xianfeng_getList($data, &$file, &$all, $exit)
|
||||
} else {
|
||||
$record['status'] = '满载';
|
||||
}
|
||||
//南阳
|
||||
if (strpos($record['city'], '南阳') !== false) {
|
||||
$record['status'] = '满载';
|
||||
}
|
||||
$record['nasname'] = $info['nasname'];
|
||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
||||
fputcsv($dnx_exit, ['先锋', $record['nasname'], date('Y-m-d H:i:s')]);
|
||||
|
||||
Reference in New Issue
Block a user