hash."/users/".$this->id."/tokens"; //echo $url; // Set URL to download curl_setopt($ch, CURLOPT_URL, $url); $data = array( 'password' => "Ichuxu#85", 'application' => "BateWorld" ); $payload = json_encode($data); // Include header in result? (0 = yes, 1 = no) curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization: Bearer c3f1d5e147a2a0d673894d1950254bc17bc85b56a924d7e09f4271a4deae7e49')); // Should cURL return or print out the data? (true = return, false = print) curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Timeout in seconds curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Download the given URL, and return output $output = curl_exec($ch); // Close the cURL resource, and free system resources curl_close($ch); //echo $output; } function gettokens() { $url="https://striketracker.highwinds.com/api/v1/accounts/".$this->hash."/users/".$this->id."/tokens"; $ch = curl_init(); echo $url; // Set URL to download curl_setopt($ch, CURLOPT_URL, $url); $data = array( 'password' => "Ichuxu#85", 'application' => "BateWorld" ); $payload = json_encode($data); // Include header in result? (0 = yes, 1 = no) curl_setopt($ch, CURLOPT_HEADER, 0); //curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Should cURL return or print out the data? (true = return, false = print) curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Timeout in seconds curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Download the given URL, and return output $output = curl_exec($ch); // Close the cURL resource, and free system resources curl_close($ch); echo $output; } function highwindsdelete($file){ $key="c3f1d5e147a2a0d673894d1950254bc17bc85b56a924d7e09f4271a4deae7e49"; $hash="n2h5a5n4"; $ch = curl_init(); $url="https://striketracker.highwinds.com/api/v1/accounts/".$this->hash."/purge"; // Set URL to download curl_setopt($ch, CURLOPT_URL, $url); $data = array( 'url' => $file, 'recursive' => "true", 'purgeAllDynamic' => 'true' ); //$payload = json_encode($data); //$payload1 = json_decode($payload); //$payload = json_encode(array("list" => $payload1)); // Include header in result? (0 = yes, 1 = no) curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization: Bearer c3f1d5e147a2a0d673894d1950254bc17bc85b56a924d7e09f4271a4deae7e49')); curl_setopt($ch, CURLOPT_POSTFIELDS, '{ "list": [ { "url": "'.$file.'", "recursive": true, "purgeAllDynamic": true } ] }'); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Should cURL return or print out the data? (true = return, false = print) curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Timeout in seconds curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Download the given URL, and return output $output = curl_exec($ch); // Close the cURL resource, and free system resources curl_close($ch); echo $output; } } function highwindsdelete($file){ $key="c3f1d5e147a2a0d673894d1950254bc17bc85b56a924d7e09f4271a4deae7e49"; $hash="t2x8q5x9"; $ch = curl_init(); $url="https://striketracker.highwinds.com/api/v1/accounts/".$hash."/purge"; // Set URL to download curl_setopt($ch, CURLOPT_URL, $url); $data = array( 'url' => $file, 'recursive' => "true", 'purgeAllDynamic' => 'true' ); //$payload = json_encode($data); //$payload1 = json_decode($payload); //$payload = json_encode(array("list" => $payload1)); // Include header in result? (0 = yes, 1 = no) curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization: Bearer c3f1d5e147a2a0d673894d1950254bc17bc85b56a924d7e09f4271a4deae7e49')); curl_setopt($ch, CURLOPT_POSTFIELDS, '{ "list": [ { "url": "'.$file.'", "recursive": true, "purgeAllDynamic": true } ] }'); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Should cURL return or print out the data? (true = return, false = print) curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Timeout in seconds curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Download the given URL, and return output $output = curl_exec($ch); // Close the cURL resource, and free system resources curl_close($ch); echo $output; } //$highwinds = new highwinds; //$highwinds->authenticate(); highwindsdelete('https://n2h5a5n4.ssl.hwcdn.net/uploads_user/8000/7653/1260070_thumb.png'); ?>