Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.17 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. $arq = fopen("neo.txt", "a");
  4. $a = curl_init();
  5. while(1){
  6.     $cache = rand(0,9999999999999999999);
  7.     //$a = curl_init("http://www.neopets.com/pound/get_adopt.phtml?r=".$cache);
  8.     curl_setopt($a, CURLOPT_URL, "http://www.neopets.com/pound/get_adopt.phtml?r=".$cache."");
  9.     curl_setopt($a, CURLOPT_RETURNTRANSFER, TRUE);
  10.  
  11.     $b = json_decode(curl_exec($a), true);
  12.     //curl_close($a);
  13.     //print_r($b);
  14.  
  15.     if(count($b) != "0"){
  16.         //for($i=0;$i<count($b);$i++){
  17.         foreach($b as $b){
  18.             //fwrite($arq, $b['name']." - ".$b['color']." ".$b['species']."\n");
  19.             if(//strtolower($b['species']) == "krawk" ||
  20.                 strtolower($b['species']) == "draik" ||
  21.                 (strtolower($b['species']) == "lupe" && strtolower($b['color']) == "halloween") ||
  22.                 (strtolower($b['species']) == "quiggle" && strtolower($b['color']) == "island")){
  23.                 adotar($b['name']);
  24.             }
  25.         }
  26.     }
  27.     sleep(1);
  28. }
  29.  
  30. function adotar($petnome){
  31.     $login = curl_init("http://www.neopets.com/login.phtml");
  32.  
  33.     curl_setopt_array($login, array(
  34.         CURLOPT_POST => TRUE,
  35.         CURLOPT_POSTFIELDS => "username=caaiiquee&password=senha",
  36.         //CURLOPT_FOLLOWLOCATION => TRUE,
  37.         CURLOPT_SSL_VERIFYPEER => FALSE,
  38.         CURLOPT_SSL_VERIFYHOST => FALSE,
  39.         CURLOPT_HEADER => TRUE,
  40.         //CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
  41.         CURLOPT_REFERER => "http://www.neopets.com/",
  42.         CURLOPT_RETURNTRANSFER => TRUE
  43.         ));
  44.  
  45.     preg_match_all("/Set-Cookie: ([^\n]+)/sim", curl_exec($login), $cookies);
  46.     $cookie = "";
  47.     foreach($cookies[1] as $coookie){
  48.         $cookie.=$coookie.";";
  49.     }
  50.     curl_close($login);
  51.  
  52.     $adotar = curl_init("http://www.neopets.com/pound/process_adopt.phtml");
  53.  
  54.     curl_setopt_array($adotar, array(
  55.         CURLOPT_POST => TRUE,
  56.         CURLOPT_POSTFIELDS => "pet_name=".$petnome,
  57.         CURLOPT_FOLLOWLOCATION => TRUE,
  58.         CURLOPT_SSL_VERIFYPEER => FALSE,
  59.         CURLOPT_SSL_VERIFYHOST => FALSE,
  60.         //CURLOPT_HEADER => TRUE,
  61.         //CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],
  62.         CURLOPT_COOKIE => $cookie,
  63.         //CURLOPT_REFERER => "http://www.neopets.com/",
  64.         CURLOPT_RETURNTRANSFER => TRUE
  65.         ));
  66.     $curl = curl_exec($adotar);
  67.     curl_close($adotar);
  68.  
  69.     die($petnome." adotado com sucesso");
  70. }
  71. //fclose($arqui);
  72. //echo "teste";
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement