Beispiel #1
0
 /**
  * Get the average rank over the week
  * 
  * @access public
  * @static  
  * @return int
  */
 public static function setRankingKeys($url = false)
 {
     $xpath = self::_getXPath($url);
     $nodes = @$xpath->query("//*[@id='rank']/table/tr");
     if (5 == $nodes->length) {
         self::$_rankKeys = array('1d' => 2, '7d' => 3, '1m' => 4, '3m' => 5);
     } else {
         if (4 == $nodes->length) {
             self::$_rankKeys = array('1d' => 0, '7d' => 2, '1m' => 3, '3m' => 4);
         } else {
             if (3 == $nodes->length) {
                 self::$_rankKeys = array('1d' => 0, '7d' => 0, '1m' => 2, '3m' => 3);
             } else {
                 if (2 == $nodes->length) {
                     self::$_rankKeys = array('1d' => 0, '7d' => 0, '1m' => 0, '3m' => 2);
                 }
             }
         }
     }
 }