Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- function code($length = 8)
- {
- $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $charactersLength = strlen($characters);
- $randomString = '';
- for ($i = 0; $i < $length; $i++) {
- $randomString .= $characters[rand(0, $charactersLength - 1)];
- }
- return $randomString;
- }
- function inStr($s, $as){
- $s = strtoupper($s);
- if(!is_array($as)) $as=array($as);
- for($i=0;$i<count($as);$i++) if(strpos(($s),strtoupper($as[$i]))!==false) return true;
- return false;
- }
- function getStr($string,$start,$end){
- $str = explode($start,$string);
- $str = explode($end,$str[1]);
- return $str[0];
- }
- while(true){
- $code = code(8);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://egift.id/'.$code);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- $headers = array();
- $headers[] = 'Connection: keep-alive';
- $headers[] = 'Cache-Control: max-age=0';
- $headers[] = 'Upgrade-Insecure-Requests: 1';
- $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';
- $headers[] = 'Sec-Fetch-Mode: navigate';
- $headers[] = 'Sec-Fetch-User: ?1';
- $headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3';
- $headers[] = 'Sec-Fetch-Site: none';
- $headers[] = 'Accept-Encoding: gzip, deflate, br';
- $headers[] = 'Accept-Language: en,id;q=0.9,en-US;q=0.8,id-ID;q=0.7';
- $headers[] = 'Cookie: _ga=GA1.2.1551220748.1546443488; _gid=GA1.2.378504854.1566623519; _gat_gtag_UA_83926611_3=1';
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $result = curl_exec($ch);
- $name_voc = getStr($result,'<span id="p_item_name">','</');
- if($name_voc){
- if(inStr($result,'https://image.giftn.co.id/mall/goods_m/0000008511.jpg')){
- echo $code.' - '.$name_voc."\n";
- } else if(inStr($result,'https://image.giftn.co.id/mall/goods_m/0000008512.jpg')){
- echo $code.' - '.$name_voc."\n";
- } else {
- echo $code." - Voucher tidak ada.\n";
- }
- } else {
- echo $code." - Voucher tidak ada.\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement