idex.php
alexa-backlink.php
include "alexa.class.php";
$alexa = new alexa();
$url = addslashes(trim($_POST['url']));
$sonuc = @$alexa->backLink($url);
if($sonuc)
{echo $sonuc;
}else
{echo 'No Data';
}
?>
alexa.class.php
class alexa{
function getResult($url){
$url = "http://www.alexa.com/siteinfo/".$url."";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://wmtarlasi.com/");
$cikti = curl_exec($ch);
curl_close($ch);
$bol = explode('',$cikti);
$global = $bol[1];
return $global;
}
function getGlobal($url){
preg_match('/(.*?)<\/a>/i',$this->getResult($url),$sonuc);
$grank = $sonuc[2];
return $grank;
}
function bolum($url){
$bol2 = explode('',$this->getResult($url));
$bolum = $bol2[1];
return $bolum;
}
function ulkeBayrak($url){
preg_match('/bolum($url),$ulke);
$ulkebayrak = $ulke[1];
return $ulkebayrak;
}
function ulkeAdi($url){
preg_match('/alt="(.*?)"\/>/i',$this->bolum($url),$ulke1);
$ulkeadi = $ulke1[1];
return $ulkeadi;
}
function ulkeRank($url){
$r1 = explode('"/>',$this->bolum($url));
$r2 = explode('',$r1[1]);
$ulkerank = trim($r2[0]);
return $ulkerank;
}
function backLink($url){
$bol = explode('',$this->getResult($url));
$r1 = explode('">',$bol[2]);
$r2 = explode('',$r1[1]);
$link = trim($r2[0]);
return $link;
}
}
?>