Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3.  
  4. function code($length = 8)
  5. {
  6. $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  7. $charactersLength = strlen($characters);
  8. $randomString = '';
  9. for ($i = 0; $i < $length; $i++) {
  10. $randomString .= $characters[rand(0, $charactersLength - 1)];
  11. }
  12. return $randomString;
  13. }
  14. function inStr($s, $as){
  15. $s = strtoupper($s);
  16. if(!is_array($as)) $as=array($as);
  17. for($i=0;$i<count($as);$i++) if(strpos(($s),strtoupper($as[$i]))!==false) return true;
  18. return false;
  19. }
  20. function getStr($string,$start,$end){
  21. $str = explode($start,$string);
  22. $str = explode($end,$str[1]);
  23. return $str[0];
  24. }
  25.  
  26.  
  27. while(true){
  28. $code = code(8);
  29. $ch = curl_init();
  30.  
  31. curl_setopt($ch, CURLOPT_URL, 'https://egift.id/'.$code);
  32. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  33. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
  34.  
  35. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  36.  
  37. $headers = array();
  38. $headers[] = 'Connection: keep-alive';
  39. $headers[] = 'Cache-Control: max-age=0';
  40. $headers[] = 'Upgrade-Insecure-Requests: 1';
  41. $headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36';
  42. $headers[] = 'Sec-Fetch-Mode: navigate';
  43. $headers[] = 'Sec-Fetch-User: ?1';
  44. $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3';
  45. $headers[] = 'Sec-Fetch-Site: none';
  46. $headers[] = 'Accept-Encoding: gzip, deflate, br';
  47. $headers[] = 'Accept-Language: en,id;q=0.9,en-US;q=0.8,id-ID;q=0.7';
  48. $headers[] = 'Cookie: _ga=GA1.2.1551220748.1546443488; _gid=GA1.2.378504854.1566623519; _gat_gtag_UA_83926611_3=1';
  49. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  50.  
  51. $result = curl_exec($ch);
  52. $name_voc = getStr($result,'<span id="p_item_name">','</');
  53.  
  54.  
  55. if($name_voc){
  56. if(inStr($result,'https://image.giftn.co.id/mall/goods_m/0000008511.jpg')){
  57. echo $code.' - '.$name_voc."\n";
  58. } else if(inStr($result,'https://image.giftn.co.id/mall/goods_m/0000008512.jpg')){
  59. echo $code.' - '.$name_voc."\n";
  60. } else {
  61. echo $code." - Voucher tidak ada.\n";
  62. }
  63. } else {
  64. echo $code." - Voucher tidak ada.\n";
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement