public function index() { $data = array(); $handle = ApiStore::make("Showapi"); $id = Request::input("id", '0'); $page = Request::input("page", '1'); for ($i = 0; $i < count($this->catelogs); $i++) { if ($id == $this->catelogs[$i]['id']) { break; } } if ($i == count($this->catelogs)) { return "error"; } $data['activeId'] = $id; if ($id == "0") { $id = ""; } $retData = $handle->getData('nethub', 'get_budejie_items', array('showapi_appid' => '11319', 'type' => $id, 'page' => $page)); $items = $handle->parseData($retData, true); if (!$items) { return "error"; } $data['catelogs'] = $this->catelogs; $data['content'] = $items['contentlist']; $data["maxPage"] = $items['allPages']; $data['page'] = $items['currentPage']; return $data; }
public function generate() { $text = Request::input("content", ""); $text = "http://" . $text; if (!$text) { return json_encode(array('showapi_res_code' => '1', 'showapi_res_error' => '参数错误')); } $par = array('showapi_appid' => '11319', 'url_long' => $text); return ApiStore::make("Showapi")->getData('nethub', 'generate_tch', $par); }
public function generate() { $size = Request::input('size', 5); $content = Request::input('content', ""); if (!$content) { return json_encode(array('showapi_res_error' => '参数错误', 'showapi_res_code' => 0)); } //$size = (int)$size; $par = array('showapi_appid' => '11319', 'size' => $size, 'content' => $content); return $data = ApiStore::make("Showapi")->getData('nethub', 'generate_qrcode', $par); }
public function getData($c, $a, $par) { $url = ApiStore::get_api_url($c, $a); $key = ApiStore::get_api_key($c, $a); $url = ApiStore::generate_api_url($url, $par); if (function_exists("curl_exec")) { $ret = $this->baidu_api_curl_get($url, $key); } else { $ret = $this->baidu_api_file_get($url, $key); } return $ret; }
public function getData($c, $a, $par) { $url = ApiStore::get_api_url($c, $a); $key = ApiStore::get_api_key($c, $a); $url = ApiStore::generate_api_url($url, $par); $url = array_merge($url, array('key' => $key)); if (function_exists("curl_exec")) { $ret = $this->juhe_api_curl_get($url, $key); } else { $ret = $this->juhe_api_file_get($url, $key); } return $ret; }
public function queryPhone() { $mobileNumber = Request::input("phone", NULL); if (!$mobileNumber) { return json_encode(array('error_code' => 0x1, 'message' => "请设置正确的电话号码或者检查网络")); } $par = array('phone' => $mobileNumber); $ret = ApiStore::make("Apix")->getData("nethub", "get_phone_info", $par); if (!$ret) { return json_encode(array('error_code' => 0x1, 'message' => "服务器异常或者网络异常")); } return $ret; }
protected function getXiaohua($id, $page) { $handle = ApiStore::make("Showapi"); if (!$handle) { return null; } $par = array('showapi_appid' => '11319', 'time' => $this->time, 'page' => $page); if ($id == 0) { $info = $handle->getData('nethub', 'get_image_joke', $par); } else { $info = $handle->getData('nethub', 'get_text_joke', $par); } return $handle->parseData($info); }
function getData($c, $a, $par) { $url = ApiStore::get_api_url($c, $a); $key = ApiStore::get_api_key($c, $a); $real_par = array(); $temp = array('showapi_timestamp' => date('YmdHis')); $real_par = array_merge($par, $temp); $sign = $this->create_sign($real_par, $key); $url = ApiStore::generate_api_url($url, $real_par); $url .= 'showapi_sign=' . $sign . '&'; if (function_exists("curl_exec")) { $ret = $this->showapi_api_curl_get($url, $key); } else { $ret = $this->showapi_api_file_get($url, $key); } return $ret; }
public function index() { $id = Request::input("id", '33'); $handle = ApiStore::make("Showapi"); $ret = array(); if (!$handle) { return 'error'; } if ($id == '33') { $info = $handle->getData('Nethub', 'get_laifudao_pic_joke', array('showapi_appid' => '11319')); } else { $info = $handle->getData('Nethub', 'get_laifudao_text_joke', array('showapi_appid' => '11319')); } $ret = $handle->parseData($info); if (!$ret) { return "error"; } $data['content'] = $ret['list']; $data['activeId'] = $id; return $data; }
protected function handleAction($action, $p) { $handle = ApiStore::make("Showapi"); if (!$handle) { return null; } $par = array('showapi_appid' => '11319'); $par = array_merge($par, $p); switch ($action) { case "hot": $info = $handle->getData('nethub', 'get_hot_music_list', $par); break; case "searchById": $info = $handle->getData('nethub', 'search_music_by_id', $par); break; case "searchByName": $info = $handle->getData('nethub', 'search_music_by_name', $par); break; } return $handle->parseData($info, true); }
public function searchExpress() { $company = Request::input('company', NULL); $express_id = Request::input('express_id', NULL); $par = array(); if (!$company || !$express_id) { $status = array(); $status['showapi_res_code'] = -1; $status['showapi_res_error'] = "查询的单号不存在或者无法连接到服务器请检查网络设置"; return $status; } /* check this express can be checked by PP KUAIDI */ $pp = $this->isPP($company); if ($pp) { $par['expresscode'] = $pp->simpleName; $par['billno'] = $express_id; $ret = ApiStore::make("Apix")->getData("nethub", "get_express_status", $par); if (isset($ret) && $ret) { $status = json_decode($ret, TRUE); if (isset($status['data'][0]['wayBills']) && $status['data'][0]['wayBills']) { return $ret; } } } $par['showapi_appid'] = "11319"; $par['nu'] = $express_id; $par['com'] = $company; $ret = ApiStore::make("Showapi")->getData("nethub", "get_express_status", $par); if (!$ret || !isset($ret)) { $status = array(); $status['showapi_res_code'] = -1; $status['showapi_res_error'] = "查询的单号不存在或者无法连接到服务器请检查网络设置"; return json_encode($status); } return $ret; }
protected function getWeixinArticleCatelogs() { return Cache::remember("weixinCatelogs", 10 * 24 * 60, function () { $catelogs = array(); $ret = ApiStore::make("Showapi")->getData('nethub', 'get_weixin_articles_catelog', array('showapi_appid' => '11319')); if ($ret) { $status = json_decode($ret, true); if ($status['showapi_res_code'] == 0) { $temp = $status['showapi_res_body']['typeList']; for ($i = 0; $i < count($temp); $i++) { for ($j = 0; $j < count($temp); $j++) { if ($i == $temp[$j]['id']) { $catelogs[] = $temp[$j]['name']; break; } else { continue; } } } } } return empty($catelogs) ? NULL : $catelogs; }); }
public function __construct() { $this->movieApiHandle = ApiStore::make("Juhe"); }