查询百度收录子域名及收录量

折腾 95 字 620 阅

简言

调用百度,查询该域名百度收录的子域名收录量

使用方法:http://域名/路径.php?url=查询域名

注:查询结果并不完全,只能获取百度收录的相关子域名,无相关收录的子域名并不能查询到。

返回样式为json格式。

PHP

<?php

$url=$_REQUEST["url"];

if(!$url){

exit(json_encode(array("code"=>1,"text"=>"请输入域名!"),320));

}

$data=json_decode(curl("http://ce.baidu.com/index/getRelatedSites?site_address=".$url),true);

if($data["code"]==10000){

exit(json_encode(array("code"=>2,"text"=>"域名输入错误!"),320));

}

if($data["code"]==0){

$array["code"]=200;

foreach($data["data"] as $v){

$array["domain"][]=$v["domain"];

$array["score"][]=$v["score"];

}

exit(json_encode($array,320));

}else{

exit(json_encode(array("code"=>3,"text"=>"查询失败!"),320));

}

function curl($url,$data=0,$header_array=0,$referer=0,$time=30,$code=0) {

    if($header_array==0) {

        $header=array("CLIENT-IP: ".getip_user(),"X-FORWARDED-FOR: ".getip_user(),'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36');

    } else {

        $header=array("CLIENT-IP: ".getip_user(),"X-FORWARDED-FOR: ".getip_user(),'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36');

        $header=array_merge($header_array,$header);

    }

//print_r($header);

    $curl=curl_init();

    curl_setopt($curl,CURLOPT_URL,$url);

    curl_setopt($curl,CURLOPT_HTTPHEADER,$header);

    if($data) {

        curl_setopt($curl,CURLOPT_POST,1);

        curl_setopt($curl,CURLOPT_POSTFIELDS,$data);

    }

    if($referer) {

        curl_setopt($curl,CURLOPT_REFERER,$referer);

    }

    curl_setopt($curl,CURLOPT_TIMEOUT,$time);

    curl_setopt($curl,CURLOPT_FOLLOWLOCATION,1);

    curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);

    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);

    curl_setopt($curl,CURLOPT_SSL_VERIFYHOST, FALSE);

    curl_setopt($curl,CURLOPT_ENCODING,'gzip,deflate');

if($code) {

        curl_setopt($curl, CURLOPT_HEADER, 1);

        $return=curl_exec($curl);

        $code_code=curl_getinfo($curl);

        curl_close($curl);

        $code_int['exec']=substr($return,$code_code["header_size"]);

        $code_int['code']=$code_code["http_code"];

        $code_int['content_type']=$code_code["content_type"];

        $code_int['header']=substr($return,0,$code_code["header_size"]);

        return $code_int;

    } else {

        $return=curl_exec($curl);

        curl_close($curl);

        return $return;

    }

}

function getip_user() {

    if(empty($_SERVER["HTTP_CLIENT_IP"]) == false) {

        $cip = $_SERVER["HTTP_CLIENT_IP"];

    } else if(empty($_SERVER["HTTP_X_FORWARDED_FOR"]) == false) {

        $cip = $_SERVER["HTTP_X_FORWARDED_FOR"];

    } else if(empty($_SERVER["REMOTE_ADDR"]) == false) {

        $cip = $_SERVER["REMOTE_ADDR"];

    } else {

        $cip = "";

    }

    preg_match("/[\d\.]{7,15}/", $cip, $cips);

    $cip = isset($cips[0]) ? $cips[0] : "";

    unset($cips);

    return $cip;

}
- THE END -
打赏 分享
评论 ( 53 )
OωO
  1. Nfcrbn

    ivermectin 3 mg for humans for sale - buy ivermectin 6 mg online stromectol 3 mg tablets price

    昨天 21:14 回复
  2. Pncezk

    canada viagra - Discount viagra no rx sildenafil 20 mg tablets cost

    一天前 回复
  3. Khgrad

    affordable essay writing - cheap custom essays essays buy

  4. Nffhno

    live casino slots online - wind creek casino online games empire casino online

  5. Jbsjrb

    ivermectin price uk - ivermectin topical ivermectin 6 mg otc

  6. Fhlmkf

    ivermectin 1% - buy stromectol uk where can i buy oral ivermectin

  7. Douzqa

    generic cialis soft tabs suppliers - Cialis without rx where to buy tadalafil online

    10月18日 回复
  8. Aprpzr

    cialis prices in mexico - realciapll pharmacy online track order

    10月17日 回复
  9. Fcfxjy

    generic over the counter viagra - viagra sildenafil 200mg viagra capsule

    10月16日 回复
  10. Kbzvui

    cheap viagra pills - united healthcare viagra viagra 100mg cheap price

    10月14日 回复
  11. Earuwl

    ivermectin 8 mg - ivermectin tablet price stromectol oral

    10月13日 回复
  12. Gxiodv

    purchase ivermectin - stromectol buy uk ivermectin 4000

    10月12日 回复
  13. Msjwey

    prednisone online pharmacy - buy cheap prednisone online prednisone price canada

    10月9日 回复
  14. Gblrmp

    buy online cialis 5mg - buy cialis uk next day delivery canadian cialis cheap

    10月9日 回复
  15. Jrxhzu

    tadalafil 20mg - buy cialis on line tadalafil tablets india online

    10月7日 回复
  16. Arsydz

    otc viagra usa - real viagra 100mg 150mg viagra

    10月6日 回复
  17. Rmwejg

    stromectol 0.1 - stromectol brand name ivermectin oral solution

    10月5日 回复
  18. Ufjnqv

    blue pill orlistat 60 - alli or xenical xenical 120mg coupons

    10月4日 回复
  19. Kqyczc

    kamagra gold 100 - fildena 120 usa and uk cenforce 200 mg - cenforce 100 usa

    10月3日 回复
  20. Xsyzsu

    side effect of plaquenil - buy prednisone deltasone 20 mg

    10月1日 回复
  21. Thukzr

    ivermectin 18mg - ivermectin new zealand ivermectin side effects

    9月26日 回复
  22. Chxwie

    my mother essay writing - buy research papers online no plagiarism best college paper writing service

    9月25日 回复
  23. Dvhfjg

    accutane 50mg - buy roaccutane accutane for sale uk

    9月24日 回复
  24. Zygtvk

    buy tadalafil online safely - purchase tadalafil tadalafil buy online

    9月23日 回复
  25. Jdlsnh

    buy sildenafil - sildenafil without a doctor prescription sildenafil alternative

    9月21日 回复
  26. Kbzvyn

    stromectol price uk - ivermectin 200 mcg generic name for ivermectin

    9月20日 回复
  27. Regafc

    purchase ivermectin - ivermectin lotion 0.5 cost of ivermectin medicine

    9月19日 回复
  28. Ahesin

    can i buy 40mg doxycycline online - cheapest doxycycline 100mg prednisolone 25mg tablet

    9月18日 回复
  29. Urbqou

    cytotec price - how to get cytotec in usa buy cytotec online australia

    9月16日 回复
  30. Umhsmn

    ventolin pills - buy ventolin ventolin price canada

    9月15日 回复
  31. Uqbngn

    lasix prescription - purchase furosemide 12.5 online lasix india

    9月14日 回复
  32. Hnzrmu

    buy prednisone without prescription - prednisone 2.5mg tab 60 mg of prednisone

    9月13日 回复
  33. Yzgspe

    ivermectin 9mg - generic stromectol buy ivermectin cream for humans

    9月12日 回复
  34. Vance Woodcock
    Vance Woodcock
    此条为私密评论,仅评论双方可见
    9月12日 回复
  35. Lsaquj

    buy cialis from india online - Us cialis sales where can i get cialis without a prescription

    9月9日 回复
  36. Zxpbvi

    sildenafil 100mg price in india - Free trial of viagra how to get cheap viagra online

    9月8日 回复
  37. Vudgqy

    buy thesis paper - term paper service thesis writing services

    9月7日 回复
  38. Wwhzhr

    medrol 8mg tablet price - buy medrol online lyrica for sale uk

    9月5日 回复
  39. Emwxqo

    amoxicillin price at cvs - amoxicillin sleep amoxil 500 mg generic name

    9月4日 回复
  40. Aolipw

    canadian online pharmacy accutane - buy accutane online where can i get accutane in australia

    9月3日 回复
  41. Rnbfwu

    prednisone online - best pharmacy prednisone 5 mg prednisone tablets

    9月1日 回复
  42. Ssluxv

    covid ivermectin - stromectol 3 mg price ivermectin tablets for sale walmart

    8月31日 回复
  43. Mxnhyd

    buy vardenafil usa - buy brand vardenafil buy vardenafil in usa

    8月30日 回复
  44. Tkfnjj

    how to order generic cialis - cialis online pharmacy usa tadalafil 20 mg soft tabs

    8月29日 回复
  45. Rhwqas

    price of sildenafil citrate - generic viagra online usa

    8月27日 回复
  46. Darwin Hermann
    Darwin Hermann
    此条为私密评论,仅评论双方可见
    8月27日 回复
  47. Ykmmsk

    where to buy neurontin - synthroid 12.5 mcg price for synthroid 150 mcg

    8月26日 回复
  48. Tzvjmd

    doxycycline 100mg best buy - doxycycline 20 mg tablets doxycycline online paypal

    8月24日 回复
  49. Gennie Hooley
    Gennie Hooley
    此条为私密评论,仅评论双方可见
    8月24日 回复
  50. Ezkahq

    cytotec prescription drug - cytotec tablet 200mg cytotec cost singapore

    8月23日 回复
  51. Nolhwx

    ventolin cost - onventolinp ventolin cost australia

    8月21日 回复
  52. Mtyyru

    stromectol price - ivermectin 3 mg tablet dosage ivermectin 1 cream

    8月20日 回复
  53. Cyrus Zimin
    Cyrus Zimin

    Use SendBulkMails.com to run email campaigns from your own private dashboard.

    Cold emails are allowed and won't get you blocked :)

    1Mil emails / mo @ $99 USDDedicated IP and Domain IncludedDetailed statistical reports (delivery, bounce, clicks etc.)Quick and easy setup with extended support at no extra cost.Cancel anytime!

    Regards,
    www.SendBulkMails.com

    2月16日 回复
感谢打赏