private function getRatingJson($status) { $fields = array('type' => "normal", 'league_ids' => 3, 'status' => $status, 'auth_code' => "B963EB9EB46B0007", 'start_dt' => rawurlencode($this->start_date), 'end_dt' => rawurlencode($this->end_date)); $fields_string = ""; foreach ($fields as $key => $value) { $fields_string .= $key . '=' . $value . '&'; } rtrim($fields_string, '&'); $json = Utils::download(self::THUUZ_URL . "?" . $fields_string); return json_decode($json); }
private function getScoresXML() { $file = sprintf("%s/%s/%d_%s_%02d.xml", $this->container->getParameter("nfl_path"), $this->container->getParameter("nfl_data_dir"), $this->year, $this->type, $this->week); $url = sprintf("http://smb.cdnak.neulion.com/fs/nfl/nfl/stats/scores/%s/%s_%s.xml", $this->year, $this->type, $this->week); $xml = Utils::download($url); if (strlen($xml) > 0) { file_put_contents($file, $xml); } else { if (file_exists($file)) { $xml = file_get_contents($file); } else { throw new \Exception("server XMl NOT FOUND"); } } return new \SimpleXMLElement($xml); }