diff --git a/api_fun/damaged_scooters/fetchnonactivescooters.php b/api_fun/damaged_scooters/fetchnonactivescooters.php new file mode 100644 index 0000000..54c49b5 --- /dev/null +++ b/api_fun/damaged_scooters/fetchnonactivescooters.php @@ -0,0 +1,100 @@ + 0) + { + // move back a byte + fseek($handle, -1, SEEK_END); + + // add the trailing comma + fwrite($handle, ',', 1); + + // add the new json string + fwrite($handle, json_encode($data) . ']'); + } + else + { + // write the first event inside an array + fwrite($handle, json_encode(array($data))); + } + + // close the handle on the file + fclose($handle); + } + + +}; + +function callAPI($url){ + //echo $url; + $curl = curl_init($url); + curl_setopt($curl, CURLOPT_FAILONERROR, true); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_HTTPHEADER, array( + 'x-api-key: bpEUTJEBTf74oGRWxaIcW7aeZMzDDODe1yBoSxi2', + 'Content-Type: application/json', + )); // set the api key + curl_setopt($curl, CURLOPT_USERAGENT,'ProductionRelease/3.8.2 (app.tier.sharing; build:3.8.2.0; iOS 12.4.4) Alamofire/4.9.1'); // set user-agent to that of the Tier.app, sniffed by burpsuite + $result = curl_exec($curl); + if(!$result){return ('api connection failed'.PHP_EOL);} + curl_close($curl); + //echo $result; + return $result; +}; + +save_latestData(); + + +?> \ No newline at end of file diff --git a/api_fun/damaged_scooters/scooter_UUID.php b/api_fun/damaged_scooters/scooter_UUID.php new file mode 100644 index 0000000..6ad07ae --- /dev/null +++ b/api_fun/damaged_scooters/scooter_UUID.php @@ -0,0 +1,75 @@ + $UUID); + if (in_array($UUID_Entry, $scooterUUID_Array)) { + echo "matched".PHP_EOL; + } else { + $additionalUUID = array('UUID' => $UUID); + $scooterUUID_Array[] = $additionalUUID ; + $jsonData = json_encode($scooterUUID_Array); + file_put_contents('./scooter_UUID.json', $jsonData); + echo "new Entry added".PHP_EOL; + } + //$json_entry = "{" . "\"URL\":" . "\"" . $api_call . $UUID . "\"" . "},"; + //file_put_contents($filename, $json_entry, FILE_APPEND | LOCK_EX); + $id++; + } +}; + +getactiveSooters(); +append_UUID(); + +?> \ No newline at end of file