how to use this code – where to past ?
If you don't have Alexa toolbar i'm sure you have seen somewhere a rank according to it, for example on BuySellAds etc... The traffic rank is based on three months of aggregated historical traffic data from millions of Alexa Toolbar users and data obtained from other, diverse traffic data sources, and is a combined measure of page views and users (reach).
So if you need it for some professional services or dunno just for fun (like me, so far) here's the code for it ready for copy/paste and just change the url.
<? class alexa { var $xml; var $values; var $alexa_address; function alexa($alexa_address,$domain) { $this->alexa_address = $alexa_address; $this->xml = $this->get_data($domain); $this->set(); } function get_data($domain) { $url = $this->alexa_address.'http://'.$domain; $xml = simplexml_load_file($url) or die('Cannot retrieve feed'); return $xml; } function set() { $this->values['rank'] = ($this->xml->SD->POPULARITY['TEXT'] ? number_format($this->xml->SD->POPULARITY['TEXT']) : 0); } function get($value) { return (isset($this->values[$value]) ? $this->values[$value] : '"'.$value.'" does not exist.'); } } $domain = "stylizedweb.com"; $alexa_connector = new alexa('http://alexa.com/xml/dad?url=',$domain); echo 'alexa rank for '.$domain.' is '.$alexa_connector->get('rank'); ?>
Have some feedback? Leave a commenthow to use this code – where to past ?
nice blog thanks
ı have followed your writing for a long time.really you have given very successful information.
In spite of my english trouale,I am trying to read and understand your writing.
And ı am following frequently.I hope that you will be with us together with much more scharings.
I hope that your success will go on.
70% of the time of website owner is consumed in experimenting towards increasing page rank and alexa rank. To start with increasing page rank one must start with downloading Alexa toolbar for IE or firefox on as many system possible. as a second step alexa widget on every page of your website, by this way every webpage opened is counted while calculating rank inspite is user does not have alexa toolbar installed knowtheworldaround.com
nevermind i figured it out, thanks
where exactly do i paste this code in?
Great information, thanks for sharing it with us. i will try it out for my newly kids portal http://www.buzziboy.com
NICE
Thanks for the link, i didn’t know who’s the original author
At least give credit where credits due.
change the variable field by :
$domain = $_SERVER['SERVER_NAME'];
Very useful.
Thanks!
Nice
very interesting, i always wondered how to do that!
on April 22, 2009
Nice Stuff! Thanks man