Advertisement
AbdulMuttaqin

BOM SMS GRAB

Sep 2nd, 2018
1,633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2.  
  3. date_default_timezone_set('Asia/Jakarta');
  4. function sendSMS($phone) {
  5.     //$phone    =   str_replace(substr(0, 2, strlen($phone)), '62', $phone);  optional, replace 08 (first) with 62 (country code)
  6.     $ch = curl_init();
  7.  
  8.     curl_setopt($ch, CURLOPT_URL, "https://p.grabtaxi.com/api/passenger/v2/profiles/register");
  9.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10.     curl_setopt($ch, CURLOPT_POSTFIELDS, "phoneNumber=$phone&countryCode=ID&name=Dtester&email=tercyduck@grabtaxi.com&deviceToken=*");
  11.     curl_setopt($ch, CURLOPT_POST, 1);
  12.     curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  13.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  14.     $headers = array();
  15.     $headers[] = "X-Request-Id: 74ec758a-aa19-4ebb-9ae6-9385ad4722x6f";
  16.     $headers[] = "Accept-Language: en-us;q=1.0, en;q=0.9";
  17.     $headers[] = "User-Agent: Grab/4.29.1 (Android 6.0.1)";
  18.     $headers[] = "Host: p.grabtaxi.com";
  19.     $headers[] = "Content-Type: application/x-www-form-urlencoded";
  20.     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  21.  
  22.     $result = curl_exec($ch);
  23.     return $result;
  24.     if (curl_errno($ch)) {
  25.         echo 'Error:' . curl_error($ch);
  26.     }
  27.     curl_close ($ch);
  28. }
  29. function PRINTOUT($x) {
  30.     $date   =   date("H:m:s");
  31.     $r      =   json_decode(sendSMS($x));
  32.     if (isset($r->phoneNumber)) {
  33.         print("[{$date}] Send [OK => ". $r->phoneNumber ."] Sleeping..\n");
  34.         sleep(60); // DO NOT ChANGe ThIS OR WiLL NOT WoRK!
  35.         PRINTOUT($x);
  36.     } else {
  37.         print("[{$date}] ERROR CODE: \n"); // status = 400 => required country code e.g: +62;
  38.         var_dump($r);
  39.     }
  40. }
  41. PRINTOUT($argv[1]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement