예제 #1
0
 public function actionArmor()
 {
     $url = new CUrlHelper();
     if ($url->execute('http://armor.kiev.ua/wot/clan/' . WotClan::currentClan()->clan_id)) {
         $xpath = new XmlPath($url->content);
         $query = $xpath->queryAll(array('armor_gk_pos' => '//*[@id="main"]/div[4]/div[6]/table[1]//tr[1]/td[2]', 'armor_gk_val' => '//*[@id="main"]/div[4]/div[6]/table[1]//tr[1]/td[1]', 'armor_random_pos' => '//*[@id="main"]/div[4]/div[6]/table[1]//tr[2]/td[2]', 'armor_random_val' => '//*[@id="main"]/div[4]/div[6]/table[1]//tr[2]/td[1]'));
         foreach ($query as $key => $val) {
             $query[$key] = strtr($val, array(',' => '.', ' ' => ''));
         }
         $clan = WotClan::currentClan();
         $clan->setAttributes($query, false);
         $clan->save(false);
     }
 }