使用 php 获取任何特定域的所有 baklink 域

问题描述 投票:0回答:1

大家好,我被困在这里了 我需要具有任何特定域的反向链接的所有域的列表。 有人可以帮助我吗? 请向我提供一些链接或一些 api 程序来获取所有反向链接。 我在 Alexa 上搜索过,他们提供了反向链接详细信息,但没有任何 api 请求。 我有一个 php 脚本来获取任何域的排名,它具有该域的所有反向链接计数,但我同时需要所有域名。

   $url="msn.com";
$xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$url);
$rank=(int)$xml->SD[1]->POPULARITY->attributes()->TEXT;
$web=(string)$xml->SD[1]->POPULARITY->attributes()->URL;
$backlink=(int)$xml->SD[0]->LINKSIN->attributes()->NUM;
echo $web." has Alexa Rank ".$rank." has backlink: ".$backlink;
php hyperlink dns alexa-internet
1个回答
1
投票

希望这对你有用..我从互联网世界找到的。

function check_back_link($remote_url, $your_link) {
  $match_pattern = preg_quote(rtrim($your_link, "/"), "/"); 
  $found = false;
  if($handle = @fopen($remote_url, "r")){
    while(!feof($handle)){
      $part = fread($handle, 1024);
      if(preg_match("/<a(.*)href=[\"']".$match_pattern."(\/?)[\"'](.*)>(.*)<\/a>/", $part)){
        $found = true;
        break;
      }
    }
    fclose($handle);
  }
  return $found;
}

使用中的功能示例。

if(check_back_link('http://www.google.com','http://www.yahoo.com')){
  echo 'link found';
}else{
  echo 'link NOT found';
};
// this prints 'link NOT found', unfortunately...

已通过 MSN 更新

function msn_backs($url){ 
    $site = fopen('http://search.live.com/results.aspx?q=link%3A'.urlencode($url),'r'); 
    while($cont = fread($site,1024657)){ 
        $total .= $cont; 
    } 
    fclose($site); 
    $match_expression = '/<h5>Page 1 of (.*) results<\/h5>/Us'; 
    preg_match($match_expression,$total,$matches); 
    return $matches[1]; 
}
© www.soinside.com 2019 - 2024. All rights reserved.