2013-03-27 76 views
0

嗨,所有我卡在这里 我需要一个包含任何特定域名的反向链接的所有域名列表。 任何人都可以帮助我吗? 请给我一些链接或一些API程序来获得所有的反向链接。 我曾在alexa上搜索过,他们提供了反向链接的详细信息,但没有提供任何api请求。 我有一个PHP脚本来获得任何域的排名,它有该域的所有反向链接计数但我需要在同一时间的所有域名。使用php获取任何特定域名的所有baklink域名

$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; 
+1

,直到你没有得到反向链接API,你可以使用 $ _ SERVER [ “HTTP_REFERER”]; 这也将用于你.. – 2013-03-27 14:21:21

+2

我认为没有免费的反向链接API了,因为雅虎已经关闭了自己的API。问题是创建一个反向链接数据库是一个非常昂贵的过程,因为你必须抓取整个网络。所以供应商为了钱而出售它。 – Aufziehvogel 2013-03-27 14:21:59

+0

我编辑了我的php代码部分。 – 2013-03-27 14:31:21

回答

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]; 
} 
+0

没有我需要链接到msn.com的其他网站的所有链接细节 – 2013-03-27 14:31:05

+0

我刚更新的代码。 – 2013-03-27 14:42:48