Ejemplo n.º 1
0
 /**
  * @access		public
  * @return		string					Returns string, containing the average load time of the URL from Alexa.
  */
 public static function Alexa_Load_Time($uri)
 {
     $str = SEOstats_Alexa::_alexa($uri);
     $html = new DOMDocument();
     @$html->loadHtml($str);
     $xpath = new DOMXPath($html);
     $p = $xpath->query("//div[@class='speedAd']//div//p");
     foreach ($p as $match) {
         if (preg_match('/Seconds/si', $match->textContent)) {
             return trim(strip_tags($match->textContent));
             exit;
         }
     }
     return 'No data available.';
 }