Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Adil
- {
- /**
- * @copyright: YarzCode
- * Negeri ini butuh keadilan, bukan hanya kesejahteraan
- * I'am Just a kids
- */
- public function support()
- {
- /**
- * I know who I am, but by upholding justice is it wrong?
- */
- $banner =
- " KPI gak perlu merasa sok bertanggung jawab. Urusin dulu aja tayangan TV yg masih banyak alaynya, bobrok dan merusak mental masyarakat Indonesia. Gausah caper!
- #TolakKPIAwasiNetflixdanYoutube\n\n";
- echo $banner;
- echo "ID Petisi? ";
- $petId = trim(fgets(STDIN));
- echo "Amount (Jumlah)? ";
- $amount = trim(fgets(STDIN));
- $i=0;
- echo "\n";
- while($i<$amount)
- {
- $check = $this->curl('http://yarzc0de.co.id/api/newad.php', 'petition_id='.$petId);
- if(json_decode($check[1],1)['success'] == true)
- {
- echo "Support telah ditambahkan, Nama: ".json_decode($check[1],1)['name']."\n";
- } else {
- echo $check[1]."\n";
- }
- $i++;
- }
- }
- private function curl($url, $post=false, $httpheader=false,$cookie=false)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- if($cookie !== false)
- {
- curl_setopt($ch, CURLOPT_COOKIE, $cookie);
- curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
- }
- if($post != false)
- {
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- }
- if($httpheader != false)
- {
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
- curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
- }
- $response = curl_exec($ch);
- $header = substr($response, 0, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
- $body = substr($response, curl_getinfo($ch, CURLINFO_HEADER_SIZE));
- curl_close($ch);
- return array($header, $body);
- }
- }
- $a = new Adil();
- $a->support();
Advertisement
Add Comment
Please, Sign In to add comment