/** * * @param WotPlayer $player */ public static function updatePlayerGlory($player) { $result = self::ajaxRequest("http://worldoftanks.ru/community/clans/show_clan_block/?spa_id={$player->player_id}"); if (!empty($result)) { if ($result['status'] == 'ok') { $data = $result['data']; if (isset($data['glory_points_block'])) { $block = $data['glory_points_block']; $glory = $player->getGlory(); if (preg_match('/id="js-glory-points".*?>(.*?)<\\/a>/', $block, $matches)) { $glory->glory_position = preg_replace('/\\D/', '', $matches[1]) . "\n"; } if (preg_match('/Очки славы: (.*?)</', $block, $matches)) { $glory->glory_points = preg_replace('/\\D/', '', $matches[1]); } $glory->save(false); } } } }