欢迎来到天天文库
浏览记录
ID:13949502
大小:211.00 KB
页数:6页
时间:2018-07-25
《基于php的网站监测接口调用代码实例》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、基于php的网站监测接口调用代码实例代码描述:基于php的网站监测接口调用代码实例代码平台:聚合数据//+---------------------------------------------------------------------- //----------------------------------//网站监测调用示例代码-聚合数据//在线接口文档:http://www.juhe.cn/
6、docs/140//---------------------------------- header('Content-type:text/html;charset=utf-8'); //配置您申请的appkey$appkey="*********************"; //************1.创建任务************$url="http://op.juhe.cn/webxmf/createTask";$params=array( "key"=>$appkey,//您申请到的APPKEY
7、 "url"=>"",//要监测的网站的根域名,注意:必须是根域名,其他不支持 "dtype"=>"",//返回的数据格式,json或xml,默认json "contactPhone"=>"",//);$paramstring=http_build_query($params);$content=juhecurl($url,$paramstring);$result=json_decode($content,true);if($result){ if($result['error_code']=='0'){
8、 print_r($result); }else{ echo$result['error_code'].":".$result['reason']; }}else{ echo"请求失败";}//************************************************** //************2.获取监测任务列表************$url="http://op.juhe.cn/webxmf/getTaskList";$params=array( "
9、key"=>$appkey,//您申请到的APPKEY "dtype"=>"",//返回的数据格式,json或xml,默认json "page"=>"",//页码 "pageSize"=>"",//每页的个数);$paramstring=http_build_query($params);$content=juhecurl($url,$paramstring);$result=json_decode($content,true);if($result){ if($result['error_code']
10、=='0'){ print_r($result); }else{ echo$result['error_code'].":".$result['reason']; }}else{ echo"请求失败";}//************************************************** //************3.获取监测网站实时数据************$url="http://op.juhe.cn/webxmf/getRealTimeData";$para
11、ms=array( "key"=>$appkey,//您申请到的APPKEY "dtype"=>"",//返回的数据格式,json或xml,默认json "sit
此文档下载收益归作者所有