<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ```powershell <?php /* http://un.jipinlantu.com/index/Joke/index http://un.jipinlantu.com/index/Joke/zhihu_daily http://un.jipinlantu.com/index/Joke/news?id=9726788 http://un.jipinlantu.com/index/Joke/new_comment?id=9726788 http://un.jipinlantu.com/index/Joke/get_address http://un.jipinlantu.com/index/Joke/videoindex http://un.jipinlantu.com/index/Joke/video_type?type=0&page=1; http://un.jipinlantu.com/index/Joke/video_detail?vid=VBMJ132DL; http://un.jipinlantu.com/index/Joke/playing_movie_list?start=0 ; * @class 笑話段子 * @Author: ecitlm * @Date: 2017-05-29 19:31:05 * @Last Modified by: ecitlm * @Last Modified time: 2017-05-30 18:04:42 */ namespace app\index\controller; class Joke { /** * 正在上映電影列表 * @return mixed */ public function playing_movie_list(){ $start = (isset($_GET['start'])) ? intval($_GET ['start']) : 0; $url="http://api.douban.com/v2/movie/in_theaters?start={$start}&count=9"; var_dump($url);die; $res=$this->HttpGet($url); return $res; } /** * 電影詳情 * @return mixed */ public function movie_info(){ $id = (isset($_GET['id'])) ? intval($_GET ['id']) : 6311303; $url="http://api.douban.com/v2/movie/subject/{$id}"; $res=$this->HttpGet($url); $arr = json_decode($res, true); return json([ 'msg' => 'success', 'code' => 1, 'data' => $arr ]); } /** * 視頻首頁接口 */ public function videoindex() { $res = $this->HttpGet("http://c.3g.163.com/nc/video/home/0-10.html"); $arr = json_decode($res, true); return json([ 'msg' => 'success', 'code' => 1, 'data' => $arr ]); } /** *視頻分類列表 */ public function video_type($type = 0, $page = 10) { $type = (isset($_GET['type'])) ? intval($_GET ['type']) : 0; $page = (isset($_GET['page'])) ? intval($_GET ['page']) : 10; $news=array( 'news_type' => array( //頭條 0 => "T1348647909107", //軍事 1 => "T1348648141035", //娛樂 2 => "T1348648517839", //體育 3 => "T1348649079062", //科技 4 => "T1348649580692", //藝術 5 => "T1441074311424", //教育 6 => "T1348654225495", //要聞 7 =>"T1467284926140" ), 'video_type' => array( //精品視頻 0 => "VAP4BGTVD", //搞笑視頻 1 => "VAP4BFE3U", //美女視頻 2 => "VAP4BG6DL", //體育視頻 3 => "VBF8F2E94", // 新聞現場 4 => "VAV3H6JSN" ) ); $video_type = $news['video_type'][$type]; if (empty($video_type)) { return json([ 'msg' => '請填寫正確的參數請求', 'code' => 0 ]); } $url = "http://c.m.163.com/nc/video/list/" . $video_type . "/y/" . $page . "-10.html"; $res = $this->HttpGet($url); $arr = json_decode($res, true); return json([ 'msg' => 'success', 'code' => 1, 'data' => $arr[$video_type] ]); } /** * @param string $vid * @return \think\response\Json */ public function video_detail($vid = "VEKKO9TJP") { $vid = $_GET['vid']; if (empty($vid)) { return json([ 'msg' => '請填寫正確的參數請求', 'code' => 0 ]); }; $url = "http://3g.163.com/touch/video/detail/" . $vid . ".html"; $res = $this->HttpGet($url); $arr = json_decode($res, true); return json([ 'msg' => 'success', 'code' => 1, 'data' => $arr ]); } /** * 獲取城市天氣預報 * @return bool|string */ public function get_weather() { $city=$_GET['city']; if(empty($city)){ $city= $this->get_city(); } $res = file_get_contents("http://api.map.baidu.com/telematics/v3/weather?location={$city}&output=json&ak=32da004455c52b48d84a3a484c0dbc99"); return json([ 'msg' => 'success', 'code' => 1, 'data' => json_decode($res, true) ]); } protected function get_city(){ $getIp = getRemoteIPAddress(); $content = file_get_contents("http://api.map.baidu.com/location/ip?ak=enYCQ2yaIIjL8IZfYdA1gi6hK2eqqI2T&ip=120.237.113.106&coor=bd09ll"); $json = json_decode($content, true); $place =urlencode($json['content']['address_detail']['city']); return $place; } //獲取IP地址 public function get_address(){ $getIp = $this->getRemoteIPAddress(); $content = file_get_contents("http://api.map.baidu.com/location/ip?ak=enYCQ2yaIIjL8IZfYdA1gi6hK2eqqI2T&ip={$getIp}&coor=bd09ll"); $json = json_decode($content, true); $latitude_longitude=$json['content']['point']['y'].",".$json['content']['point']['x']; $address = file_get_contents("http://api.map.baidu.com/geocoder/v2/?ak=enYCQ2yaIIjL8IZfYdA1gi6hK2eqqI2T&location={$latitude_longitude}&output=json&pois=0"); $arr= json_decode($address, true); echo "你當前的位置:".$arr['result']['formatted_address'].$arr['result']['sematic_description']."<br>"; echo "你當前IP:".$getIp; } //獲取ip public function getRemoteIPAddress() { global $ip; if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else if(getenv("REMOTE_ADDR")) $ip = getenv("REMOTE_ADDR"); else $ip = "Unknow"; return $ip; } /** * @title 笑話接口 * @param page 是 int 頁數 * @return 返回數據實例 * @example 調用示例 * @method GET http://192.168.1.2/api/Joke/index?page=10 * @author xing <fbiufo@vip.qq.com> */ public function index($page = 10) { $page = (isset($_GET['page'])) ? intval($_GET ['page']) : 10; $url = "http://3g.163.com/touch/jsonp/joke/chanListNews/T141931628472/2/{$page}-10.html?callback=data"; $res = $this->HttpGet($url); $arr = json_decode(substr($res, 5, -1), true); dump($arr);die; // return json([ // 'msg' => 'success', // 'code' => 1, // 'data' => $arr['段子'] // ]); } /** * 最新日報列表 * @return \think\response\Json */ public function zhihu_daily(){ $url="http://news-at.zhihu.com/api/4/news/latest"; $va=file_get_contents($url); dump(json_decode($va, true)); } /** * 知乎日報文章詳情 * @param string $id * @return \think\response\Json */ public function news($id=""){ $id=intval($_GET ['id']); if(empty($id)){ return json([ 'msg' => '參數id不能為空', 'code' => 0, ]); } $url="http://news-at.zhihu.com/api/4"."/news/{$id}"; $va=file_get_contents($url); dump(json_decode($va, true)); } /** * 知乎日報短評論 * @return \think\response\Json */ public function new_comment(){ $id=intval($_GET ['id']); if(empty($id)){ return json([ 'msg' => '參數id不能為空', 'code' => 0, ]); } $url="http://news-at.zhihu.com/api/4"."/story/{$id}/short-comments"; $va=file_get_contents($url); dump(json_decode($va, true)); } /* * * @param unknown $url */ function HttpGet($url,$status=false){ // var_dump($url);die; $curl = curl_init (); curl_setopt ( $curl, CURLOPT_URL, $url); curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, true ); curl_setopt ( $curl, CURLOPT_TIMEOUT,1000 ); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36'); //curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/600.1.3 (KHTML, like Gecko) Version/8.0 Mobile/12A4345d Safari/600.1.4'); if($status){ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept:application','X-Request:JSON','X-Requested-With:XMLHttpRequest')); } //如果用的協議是https則打開鞋面這個注釋 curl_setopt ( $curl, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $res = curl_exec ( $curl ); curl_close ( $curl ); return $res; } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看