Alexa Introduction
Alexa's web site has two main rankings: comprehensive rankings and category rankings.
Comprehensive rankings are also called Absolute rankings, that is, a particular site in all sites in the rankings. Alexa publishes a new website comprehensive ranking every three months. This ranking is based on the geometric average of the number of user links (the users Reach) and the page views three-month cumulative.
Category ranking, one is categorized by topic, such as news, entertainment, shopping, etc., Alexa gives a particular site in the same type of site ranking. Second, according to the language classification, currently divided into 20 languages, such as English website, Chinese website [Chinese (simpl) and Chinese (Trad)], and so on, give a specific site in all such language site rankings.
Alexa Rankings is a commonly cited indicator used to evaluate a site's traffic. In fact, Alexa rankings are based on the user download and install Alexa Tools Bar embedded in IE, Firefox and other browsers, so as to monitor their access to the site data statistics, therefore, its ranking data is not absolute authority. But because it provides the comprehensive ranking, the number of visits ranked, page visits ranking and other evaluation indicators information, and there is no and it is difficult to have a more scientific and reasonable evaluation reference.
Get Alexa site rankings, traffic, visits, page views
So, how does PHP get Alexa site rankings, traffic, volume of visits, page views?
- <?php
- /**
- * Get Alexa Rank
- *
- * @param Domain Name $Domain
- * @return Alexa Rank
- * @copyright Jsmile http://www.uedsc.com/
- */
- function Getalexarank ($Domain) {
- $line = "";
- $data = "";
- $URL = "Http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url=". $Domain;
- $fp = fopen ($URL, "R");
- if ($fp) {
- while (!feof ($fp)) {
- $line = fgets ($FP);
- $data. = $line;
- }
- $p = Xml_parser_create ();
- Xml_parse_into_struct ($p, $data, $vals);
- Xml_parser_free ($p);
- for ($i =0; $i <count ($vals); $i + +) {
- if ($vals [$i] ["tag"]== "popularity") {
- return $vals [$i] ["Attributes"] ["TEXT"];
- }
- }
- }
- }
- ?>
How to use:
- echo Getalexarank (www.uedsc.com);
PHP get Alexa website Ranking, traffic, volume of visits, page views code function sharing