Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('Asia/Jakarta');
- function sendSMS($phone) {
- //$phone = str_replace(substr(0, 2, strlen($phone)), '62', $phone); optional, replace 08 (first) with 62 (country code)
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://p.grabtaxi.com/api/passenger/v2/profiles/register");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "phoneNumber=$phone&countryCode=ID&name=Dtester&email=tercyduck@grabtaxi.com&deviceToken=*");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $headers = array();
- $headers[] = "X-Request-Id: 74ec758a-aa19-4ebb-9ae6-9385ad4722x6f";
- $headers[] = "Accept-Language: en-us;q=1.0, en;q=0.9";
- $headers[] = "User-Agent: Grab/4.29.1 (Android 6.0.1)";
- $headers[] = "Host: p.grabtaxi.com";
- $headers[] = "Content-Type: application/x-www-form-urlencoded";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- return $result;
- if (curl_errno($ch)) {
- echo 'Error:' . curl_error($ch);
- }
- curl_close ($ch);
- }
- function PRINTOUT($x) {
- $date = date("H:m:s");
- $r = json_decode(sendSMS($x));
- if (isset($r->phoneNumber)) {
- print("[{$date}] Send [OK => ". $r->phoneNumber ."] Sleeping..\n");
- sleep(60); // DO NOT ChANGe ThIS OR WiLL NOT WoRK!
- PRINTOUT($x);
- } else {
- print("[{$date}] ERROR CODE: \n"); // status = 400 => required country code e.g: +62;
- var_dump($r);
- }
- }
- PRINTOUT($argv[1]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement