Alexa Rank Checker Script with PHP

Here i share script to check alexa rank of website. This script may be useful for those who want to find alexa rank massively.

alexa rank checker script

 How Important Alexa rank or Alexa ranking for a website or blog? 

For those website owners who do not make the website to make money on the internet, then the Alexa rank is not very useful. However, although useless, sometimes alexa rank became a prestige, because if alexa rank is good then should be said of the website or blog is a popular blog.

Unlike the web owner who makes his web as a place to make money on the internet, alexa rank is very important. Why is it important? because the places to make money on the internet such as Text Link Advertisement, Sponsored Reviews, ReviewMe, Ask2link and webs of other money-making Alexa rank as a benchmark. The better alexa rank you have, it will be flocking also the advertisers who want to advertise on your website.

I myself use this alexa rank script to check the web at Flippa massively.

 Here alexa rank checker script with PHP 

<?php
	function get_rank($domain){
		$url = "http://data.alexa.com/data?cli=10&dat=snbamz&url=".$domain;
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2);
		curl_setopt($ch, CURLOPT_URL, $url);
		$data = curl_exec($ch);
		curl_close($ch);
		$xml = new SimpleXMLElement($data);
		if($popularity = @$xml->xpath("//POPULARITY"))
		{
			$rank = number_format((string)$popularity[0]['TEXT']);
		}else
		{
			$rank = 'N/A';
		}
		return $rank;
	}
	echo '
		<form method="post">
 		<table>
 		<tr><td>Domain name <br/><textarea name="url" rows="20" cols="30"></textarea></td></tr>
 		<tr><td ><input type="submit" value="Submit" name="submit" /></td></tr>';
	echo '</table></form>';
	if (isset($_POST['submit']))
	{
		$list=$_POST['url'];
		$array=explode("\n",$list);
		print_r(count($array).'<br/>');
		for($i=0;$i<count($array);$i++)
		{
			$A=get_rank($array[$i]);
			echo $array[$i].' --> '.$A.'<br/>';
		}
	}
?>

Okay, you can modify that alexa rank checker by your self, next time i will share how to check alexa site from flippa site. 🙂

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

%d bloggers like this: