From c25866717d0254d694cdd6654412e4b2ea21b122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Fri, 26 Mar 2021 15:52:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E9=B9=B0=E7=BA=BF=E8=B7=AF=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/linedata/get_line_list.php | 200 +++++++++++++++++------------- 1 file changed, 117 insertions(+), 83 deletions(-) diff --git a/script/linedata/get_line_list.php b/script/linedata/get_line_list.php index 27dcbf9..9ac27ab 100755 --- a/script/linedata/get_line_list.php +++ b/script/linedata/get_line_list.php @@ -7,7 +7,6 @@ * @LastEditors: Please set LastEditors * @LastEditTime: 2020-12-05 17:34:41 */ - $is_script = 1; include_once __DIR__ . '/../../index.php'; include_once __DIR__ . '/auto_format.php'; @@ -15,31 +14,13 @@ use app\api\model\Product; $product_model = new Product; $product_list = $product_model->field('Id,Token')->fetchAll(); -// // //测试用 -// $time = time(); -// $noce = md5(time()); -// $apikey = 'd50f2b2ffd421efa67df8efb96d5ff6c'; -// $sign = md5($time.$noce.$apikey); -// $url = "http://106.54.198.154/api/getNodeList?agentid=admin1&ti=".$time."&nonce=".$noce."&sign=".$sign; -// $xingxing = json_decode(file_get_contents($url), true)['data']; -// print_r($xingxing);die; -// 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); -// } - - -// $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']; -// print_r($xunlian);die; +// $laoying_data = get_product(__DIR__ . '/data/laoying.csv'); +// $laoying_f = fopen(__DIR__ . '/data/laoying.csv', 'w'); +// $laoying = file_get_contents('http://list.wzvps.com/'); +// //写入老鹰文件 +// laoying_getList($laoying, $laoying_f, $all, $laoying_data); // die; @@ -124,17 +105,17 @@ fclose($mogu_f); $laoying_data = get_product(__DIR__ . '/data/laoying.csv'); $laoying_f = fopen(__DIR__ . '/data/laoying.csv', 'w'); -$laoying = json_decode(get_content('https://dl.ipduoduo.com/api/area?_=1604541004026', $product_list[4]['Token']), true)['data']; +$laoying = file_get_contents('http://list.wzvps.com/'); //写入老鹰文件 -tiantian_getList($laoying, $laoying_f, $all, $laoying_data, '老鹰'); +laoying_getList($laoying, $laoying_f, $all, $laoying_data); fclose($laoying_f); -$shihui_data = get_product(__DIR__ . '/data/shihui.csv'); -$shihui_f = fopen(__DIR__ . '/data/shihui.csv', 'w'); -$shihui = get_content('http://39.96.182.192:8888/agent.html', $product_list[15]['Token']); -//写入实惠文件 -shihui_getList($shihui, $shihui_f, $all, $shihui_data); -fclose($shihui_f); +// $shihui_data = get_product(__DIR__ . '/data/shihui.csv'); +// $shihui_f = fopen(__DIR__ . '/data/shihui.csv', 'w'); +// $shihui = get_content('http://39.96.182.192:8888/agent.html', $product_list[15]['Token']); +// //写入实惠文件 +// shihui_getList($shihui, $shihui_f, $all, $shihui_data); +// fclose($shihui_f); $gongxiang_data = get_product(__DIR__ . '/data/gongxiang.csv'); $gongxiang_f = fopen(__DIR__ . '/data/gongxiang.csv', 'w'); @@ -485,59 +466,112 @@ function mogu_getList($data, &$file, &$all, $exit, $product_name) } -function shihui_getList($html, &$file, &$all, $exit) +function laoying_getList($html, &$file, &$all, $exit) { -// global $dnx_exit, $dnx_has_exit; -// $key = ''; -// $list1 = []; -// preg_match("/
(.*\s*?)
<\/p><\/div>/is", $html, $result); -// preg_match_all("/
(.*?)<\/p>/is", $result[0], $result);
-// foreach ($result[0] as $k => $info) {
-// $record = [];
-// $record['name'] = '实惠';
-// if ($k == 0 || $k == 5) {
-// continue;
-// } else {
-// $list = explode('
', $info);
-// $i = 0;
-// foreach ($list as $v) {
-// $v = trim($v);
-// $v = trim(str_replace(' ', '', $v), '