Display Alexa Traffic Rank Statistics (Alexa/yahoo/google)

<!--Daily Traffic Rank Trend-->
<script language="JavaScript" type="text/javascript" src="http://xsltcache.alexa.com/traffic_graph/js/g/b/6m?&amp;u=http%3A%2F%2Fwww.iteye.com+++++"></script>


<!--Daily Traffic Rank Trend-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=t&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">


<!--Daily Reach in Percent-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=r&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">


<!--Daily Page Views-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=p&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">

 

 

 

<!--Daily Traffic Rank Trend-->
<script language="JavaScript" type="text/javascript" src="http://xsltcache.alexa.com/traffic_graph/js/g/b/6m?&amp;u=http%3A%2F%2Fwww.iteye.com+++++"></script>
<!--Daily Traffic Rank Trend-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=t&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">
<!--Daily Reach in Percent-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=r&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">
<!--Daily Page Views-->
<img src="http://traffic.alexa.com/graph?&amp;w=400&amp;h=220&amp;o=f&amp;c=1&amp;y=p&amp;b=ffffff&amp;r=1m&amp;u=iteye.com&amp;">

 

 

 

Rank as per alexa.com:

 

<?php
function AlexaRank( $url )
{
	preg_match( '#<POPULARITY URL="(.*?)" TEXT="([0-9]+){1,}"/>#si', file_get_contents('http://data.alexa.com/data?cli=10&dat=s&url=' . $url), $p );
	return ( $p[2] ) ? number_format( intval($p[2]) ):0;
}
 
echo "Rank as per alexa.com: <br />";
$domains = array( 'google.com', 'qq.com', 'yahoo.com', 'bing.com' );
foreach ( $domains as $domain ) echo $domain, ' - ', AlexaRank( $domain ), '<br />', PHP_EOL;
 
?>

 

Google Inlinks amount
Google Backlinks amount
Yahoo Inlinks amount
Yahoo Backlinks amount
Alexa Ranking

 

 

<?PHP
	
	echo alexa('qq.com');

	function googleindexed($domain) {
		$results='';
		$query="http://www.google.com/search?q=site:".urlencode($domain)."";
		$results=file_get_contents($query);

		preg_match("/About (.+?) results/", strip_tags($results), $match);
		return (isset($match) && isset($match[1])) ? $match[1] : 0;
    }

    function googlebls($domain) {
		$results='';
		$query="http://www.google.com/search?q=link:".urlencode($domain)."";
		$results=file_get_contents($query);

		preg_match('/<div id=resultStats>(.+?) result/ism', $results, $match);
		return (isset($match) && isset($match[1])) ? str_replace('About ','',$match[1]) : 0;
    }

    function yahooindexed($domain) {
		$results='';

		$query="http://siteexplorer.search.yahoo.com/siteexplorer/search?ei=UTF-8&p=".urlencode($domain)."&bwm=p&bwms=p&searchbwm=Explore+URL";
		$results=file_get_contents($query);
		preg_match("/Pages \((.+?)\)/", strip_tags($results), $match);
		@$matchtrimmed=array_walk($match,'trim_value');

		return (isset($match) && isset($match[1])) ? trim(str_replace("about","",$match[1])) : 0;
    }

    function yahoobls($domain) {
		$results='';

		$query="http://siteexplorer.search.yahoo.com/siteexplorer/search?ei=UTF-8&p=".urlencode($domain)."&bwm=p&bwms=p&searchbwm=Explore+URL";

		$results=file_get_contents($query);
		preg_match("/Inlinks \((.+?)\)/", strip_tags($results), $match);

		return (isset($match) && isset($match[1])) ? trim(str_replace("about","",$match[1])) : 0;
    }

    function alexa($domain){
    	$results = '';
    	$query = 'http://www.alexa.com/siteinfo/'.$domain;

    	$results=file_get_contents($query);
    	preg_match('%<img src="/images/icons/globe-sm.jpg" alt="Global" style="margin-bottom:-2px;"/>(.+?)</div>%ism', $results, $match);

		return (isset($match) && isset($match[1])) ? trim($match[1]) : 0;
    }


?>

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值