Advertisement
drculun

gojekbyindox0d3v2 - function.php

Jun 13th, 2022 (edited)
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.68 KB | None | 0 0
  1. <?php
  2. function request($url, $token = null, $data = null, $pin = null, $otpsetpin = null, $uuid = null){
  3. $header[] = "Host: api.gojekapi.com";
  4. $header[] = "User-Agent: okhttp/3.10.0";
  5. $header[] = "Accept: application/json";
  6. $header[] = "Accept-Language: id-ID";
  7. $header[] = "Content-Type: application/json; charset=UTF-8";
  8. $header[] = "X-AppVersion: 3.46.1";
  9. $header[] = "X-UniqueId: ".time()."57".mt_rand(1000,9999);
  10. $header[] = "Connection: keep-alive";
  11. $header[] = "X-User-Locale: id_ID";
  12. $header[] = "X-Location: -6.220".mt_rand(100,999).",106.77".mt_rand(1000,9999);
  13. if ($pin):
  14. $header[] = "pin: $pin";
  15.     endif;
  16. if ($token):
  17. $header[] = "Authorization: Bearer $token";
  18. endif;
  19. if ($otpsetpin):
  20. $header[] = "otp: $otpsetpin";
  21. endif;
  22. if ($uuid):
  23. $header[] = "User-uuid: $uuid";
  24. endif;
  25. $c = curl_init("https://api.gojekapi.com".$url);
  26.     curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
  27.     curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
  28.     if ($data):
  29.     curl_setopt($c, CURLOPT_POSTFIELDS, $data);
  30.     curl_setopt($c, CURLOPT_POST, true);
  31.     endif;
  32.     curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
  33.     curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
  34.     curl_setopt($c, CURLOPT_HEADER, true);
  35.     curl_setopt($c, CURLOPT_HTTPHEADER, $header);
  36.     $response = curl_exec($c);
  37.     $httpcode = curl_getinfo($c);
  38.     if (!$httpcode)
  39.         return false;
  40.     else {
  41.         $header = substr($response, 0, curl_getinfo($c, CURLINFO_HEADER_SIZE));
  42.         $body   = substr($response, curl_getinfo($c, CURLINFO_HEADER_SIZE));
  43.     }
  44.     $json = json_decode($body, true);
  45.     return $body;
  46. }
  47. function save($filename, $content)
  48. {
  49.     $save = fopen($filename, "a");
  50.     fputs($save, "$content\r\n");
  51.     fclose($save);
  52. }
  53. function nama()
  54.     {
  55.     $ch = curl_init();
  56.     curl_setopt($ch, CURLOPT_URL, "http://ninjaname.horseridersupply.com/indonesian_name.php");
  57.     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  58.     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  59.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  60.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  61.     $ex = curl_exec($ch);
  62.     // $rand = json_decode($rnd_get, true);
  63.     preg_match_all('~(&bull; (.*?)<br/>&bull; )~', $ex, $name);
  64.     return $name[2][mt_rand(0, 14) ];
  65.     }
  66. function getStr($a,$b,$c){
  67.     $a = @explode($a,$c)[1];
  68.     return @explode($b,$a)[0];
  69. }
  70. function getStr1($a,$b,$c,$d){
  71.         $a = @explode($a,$c)[$d];
  72.         return @explode($b,$a)[0];
  73. }
  74.  
  75. function color($color = "default" , $text)
  76.     {
  77.         $arrayColor = array(
  78.             'grey'      => '1;30',
  79.             'red'       => '1;31',
  80.             'green'     => '1;32',
  81.             'yellow'    => '1;33',
  82.             'blue'      => '1;34',
  83.             'purple'    => '1;35',
  84.             'nevy'      => '1;36',
  85.             'white'     => '1;0',
  86.         );  
  87.         return "\033[".$arrayColor[$color]."m".$text."\033[0m";
  88.     }
  89. function fetch_value($str,$find_start,$find_end) {
  90.     $start = @strpos($str,$find_start);
  91.     if ($start === false) {
  92.         return "";
  93.     }
  94.     $length = strlen($find_start);
  95.     $end    = strpos(substr($str,$start +$length),$find_end);
  96.     return trim(substr($str,$start +$length,$end));
  97. }
  98. function hari_ini(){
  99.     $hari = date ("D");
  100.  
  101.     switch($hari){
  102.         case 'Sun':
  103.             $hari_ini = "MINGGU";
  104.         break;
  105.  
  106.         case 'Mon':        
  107.             $hari_ini = "SENIN";
  108.         break;
  109.  
  110.         case 'Tue':
  111.             $hari_ini = "SELASA";
  112.         break;
  113.  
  114.         case 'Wed':
  115.             $hari_ini = "RABU";
  116.         break;
  117.  
  118.         case 'Thu':
  119.             $hari_ini = "KAMIS";
  120.         break;
  121.  
  122.         case 'Fri':
  123.             $hari_ini = "JUMAT";
  124.         break;
  125.  
  126.         case 'Sat':
  127.             $hari_ini = "SABTU";
  128.         break;
  129.        
  130.         default:
  131.             $hari_ini = "Tidak di ketahui";    
  132.         break;
  133.     }
  134.  
  135.     return "" . $hari_ini . "-";
  136.  
  137. }
  138. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement