get() публичный статический Метод

public static get ( $url, $header = [], &$setcookie = "" )
Пример #1
0
 public static function query($query_date, $from_station, $to_station)
 {
     $url = 'https://kyfw.12306.cn/otn/lcxxcx/query?';
     $param = array('purpose_codes' => 'ADULT', 'queryDate' => $query_date, 'from_station' => $from_station, 'to_station' => $to_station);
     $url .= http_build_query($param);
     do {
         $restul = Helper_Http::get($url);
         $rt = json_decode($restul, true);
         if (isset($rt['status']) && $rt['status']) {
             self::do_query($rt);
         } else {
             if (isset($rt['messages'])) {
                 var_dump($rt['messages']);
             } else {
                 var_dump($restul);
             }
         }
     } while (true);
 }
Пример #2
0
 public static function get_detail($topic_id)
 {
     $url = "https://frodo.douban.com/api/v2/group/topic/{$topic_id}?udid=4552fbb18d3e2d2348f02a23070a45b78b50a82f&device_id=4552fbb18d3e2d2348f02a23070a45b78b50a82f&channel=Douban&apiKey=0dad551ec0f84ed02907ff5c42e8ec70&os_rom=android";
     $result = Helper_Http::get($url, self::$header);
     return json_decode($result, true);
 }
Пример #3
0
 public function check_state($uid, $bookId, $email)
 {
     $url = 'http://202.206.242.99/opac/ajax_item.php?marc_no=';
     $url .= $bookId;
     $html = Helper_Http::get($url);
     if (mb_strstr($html, '可借', 'UTF-8')) {
         Ysu_LibraryModel::find_book($uid, $bookId);
         $detail = '状态:可借阅' . "\n" . '详情:' . 'http://sohow.sinaapp.com/ysu/detail?id=' . $bookId;
         Tool_Mail::send($email, '可借阅提醒', $detail);
         $this->send_msg($uid, $detail);
         return true;
     }
     return false;
 }