User: Administrator Date: 2015/4/11 Time: 16:42
コード例 #1
0
ファイル: ziroom.php プロジェクト: sohow/12306
 public static function get_house_detail($house_code)
 {
     $url = 'http://interfaces.ziroom.com/index.php?_p=api_mobile&_a=detailShow';
     $data = "sign=87a729826ea08ac03754b8d3facce3fe&uid=bc867dfa-3b87-1790-8ccf-3b5bdab53f77&timestamp=1458125599&house_code={$house_code}&city_code=110000";
     $result = Helper_Http::post($url, $data);
     $rt = json_decode($result, true);
     //print_r($rt);exit;
     return $rt['data'][0];
 }
コード例 #2
0
ファイル: 123.php プロジェクト: hengqujushi/12306
 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);
 }
コード例 #3
0
ファイル: douban.php プロジェクト: sohow/12306
 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);
 }
コード例 #4
0
ファイル: Logging.class.php プロジェクト: godruoyi/portal
 public function write($log_msg, $level = NULL, $sys_id = NULL)
 {
     if (empty($log_msg)) {
         return;
     }
     if (is_null($level) || !isset(self::$_LEVEL_INDEX[$level])) {
         $level = $this->_default_wirte_level;
     }
     $level_index = self::$_LEVEL_INDEX[$level];
     if ($level_index < $this->_level_index) {
         echo 'OK';
         return;
     }
     if (is_null($sys_id)) {
         $sys_id = $this->_sys_id;
     }
     // 开始生成要写入的msg
     $msg = '';
     // 必要时把这里抽象出去,可以自己组合
     $time_str = date('Y-m-d H:i:s');
     $client_ip = Helper_Http::clientIp();
     if (!$client_ip) {
         $client_ip = '-';
     }
     if (empty($sys_id)) {
         $sys_id = '-';
     }
     // $msg = "[{$time_str} {$level} {$client_ip} {$sys_id}]{$log_msg}\n";
     // 2015-09-14更新方法,不配置和配置为ture为要写入,配置为false为不写入
     $msg = "{$time_str}\t{$level}\t{$client_ip}\t{$log_msg}\n";
     if (!isset($this->_conf['write_local']) || $this->_conf['write_local']) {
         $this->_writer->write($msg);
         if (!empty($this->_hooker)) {
             foreach ($this->_hooker as $call) {
                 call_user_func_array($call, array($msg, $level, $level_index, $sys_id));
             }
         }
     }
     // write local log
     // 变更逻辑,只有配置了write_zmq才写zmq日志
     if ($this->_conf['write_zmq']) {
         $this->_write_zmq($sys_id, $msg);
     }
     return;
 }
コード例 #5
0
ファイル: Ysu.php プロジェクト: yang22t/ysu
 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;
 }