client_id.$this->Secretkey); $url = 'http://www.ytread.com/apis/share/get_book_list.php?ssid='.$this->ssid.'&sign='.$sign; $data = $this->curl_gets($url); $data = json_decode($data,true); if($data['code']==0){ return false; }else{ return $data['data']; } } // 获取书籍属性 public function GetBookAttr($aid){ $sign = md5($this->client_id.$this->Secretkey.$aid); $url = 'http://www.ytread.com/apis/share/get_book_info.php?ssid='.$this->ssid.'&sign='.$sign.'&aid='.$aid; $data = $this->curl_gets($url); $data = json_decode($data,true); if($data['code']==0){ return false; }else{ return $data['data']; } } // 获取书籍章节列表 public function GetChapterList($aid){ $sign = md5($this->client_id.$this->Secretkey.$aid); $url = 'http://www.ytread.com/apis/share/get_chapter_list.php?ssid='.$this->ssid.'&sign='.$sign.'&aid='.$aid; $data = $this->curl_gets($url); $data = json_decode($data,true); if($data['code']==0){ return false; }else{ return $data['data']; } } // 获取章节内容 public function GetChapterContent($aid,$cid){ $sign = md5($this->client_id.$this->Secretkey.$aid.$cid); $url = 'http://www.ytread.com/apis/share/get_chapter_content.php?ssid='.$this->ssid.'&sign='.$sign.'&aid='.$aid.'&cid='.$cid; $data = $this->curl_gets($url); $data = json_decode($data,true); if($data['code']==0){ return false; }else{ return $data['data']; } } public function curl_gets($url=''){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true ); $output = curl_exec($ch); return $output; } }