-'.$obj->{'msg'}->{'desk'}); $model = $obj['data']['machineInfo']['subSeries']; $pn = $obj['data']['machineInfo']['product']; $spec = $obj['data']['machineInfo']['productName']; $spec = str_replace(array('NBLN ','NB LN '), '', $spec); // del lishnee $waranty_start = $obj['data']['currentWarranty']['startDate']; $waranty_rem = $obj['data']['currentWarranty']['remainingMonths']; $country = $obj['data']['machineInfo']['shipToCountry']; if ($country == 'UA') { $country = 'Ukraine'; file_put_contents('ua_sn.txt', $sern." - ".$model." ( ".$pn." ) ".$spec." - ".$waranty_rem." - ".$waranty_start.PHP_EOL, FILE_APPEND); } //echo( $obj['msg']['desc'].'

'); // sostoyanie zaprosa - Success //echo( $obj['data']['machineInfo']['subSeries'].'
'); // MODEL - LENOVO-V15-G3-IAP //echo( $obj['data']['machineInfo']['product'].'
'); // partnumber - 82TT00KWRA //echo( $obj['data']['machineInfo']['productName'].'
'); // short harakteristics - NBLN V15 G3 IAP I3 8G 8G 512G NOS //echo( $obj['data']['currentWarranty']['startDate'].'
'); // start date - 2021-11-24 //echo( $obj['data']['currentWarranty']['remainingMonths'].'
'); // termin gar v misiach zalyshok - 31 //echo( $obj['data']['machineInfo']['shipToCountry'].'


'); // UA file_put_contents('all_sn.txt', $country." - ".$sern." - ".$model." ( ".$pn." ) ".$spec." - ".$waranty_rem." - ".$waranty_start.PHP_EOL, FILE_APPEND); } $i++; if ($i == 35938) break; // pause каждых 10 раз if ($i % 10 == 0) sleep (1); } // foreach //print_r($obj); $now = new DateTime(); $interval = $now->diff($start); echo("
"."Время работы парсера: " . $interval->format('%hч %iмин %sсек'). ' i: ' . $i); file_put_contents('logt.txt', date('d-m h:i:s')." - FINISH - ".$interval->format('%hч %iмин %sсек'). ' i: ' . $i. ' ni: ' . $ni.PHP_EOL, FILE_APPEND); function generator_words($chars, $length, &$words, $prefix = '') { if (strlen($prefix) == $length) { $words[] = $prefix; return; } for ($i = 0; $i < strlen($chars); $i++) { generator_words($chars, $length, $words, $prefix . $chars{$i}); } return; } ?>