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;
    }


?>

 

 

 

 

你可能感兴趣的:(JavaScript,C++,c,C#,F#)