Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1.     function getCurl($url) {       
  2.         $ch = curl_init(); 
  3.        
  4.         curl_setopt($ch, CURLOPT_URL, $this->location.$url);
  5.         curl_setopt($ch, CURLOPT_PROXY, $this->proxy);
  6.         curl_setopt($ch, CURLOPT_HEADER, false);
  7.         curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  8.         $query = curl_exec($ch);
  9.            
  10.         if($query === false) {
  11.             $this->addLog('curl', curl_error($ch));
  12.            
  13.             return $this->sendError(curl_error($ch));
  14.         } else return $query;
  15.        
  16.         curl_close($ch);       
  17.     }
  18.  
  19.     function bossInfo() {
  20.         $url = json_decode($this->getCurl($this->location.'get_boss?ts='.time()), true);
  21.        
  22.         $bossInfo['FinishTime'] =   $url['finish_time'];
  23.         $bossInfo['BossHP'] =       $url['boss_health'];
  24.  
  25.         return $bossInfo;
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement