public function getEvents($sport_id, $tournir_id, $tournir_url) { $xml = parent::getEvents($sport_id, $tournir_id, $tournir_url); $tournir_node = $xml->addChild('Events'); $file_name = $this->league_path . $tournir_id; $url = $this->host . "/engine.php?act=co&co={$tournir_id}"; $referer = $this->host . (string) $this->sport_node['Url']; $html = download_or_load($this->debug, $file_name . ".html", $url, "GET", $referer); $this->extract_bets($tournir_node, $html, (string) $this->sport_node['Sign'], $tournir_id); if ($this->debug) { file_put_contents($file_name . ".xml", $xml->asXML()); } return $xml; }
public function getEvents($sport_id, $tournir_id, $tournir_url) { $xml = parent::getEvents($sport_id, $tournir_id, $tournir_url); $tournir_node = $xml->addChild('Events'); $file_name = $this->league_path . $tournir_id; $rnd = rand(1000000000, 2000000000); $url = $this->host . "/bets/bets2.php?rnd={$rnd}"; $referer = $this->host . (string) $this->sport_node['Url']; $post_hash['time'] = 1; $post_hash['gcheck'] = 9; $post_hash['line_id[]'] = $tournir_id; $html = download_or_load($this->debug, $file_name . ".html", $url, "POST", $referer, $post_hash); $this->extract_events($tournir_node, win1251_to_utf8($html), (string) $this->sport_node['Sign'], $tournir_id); if ($this->debug) { file_put_contents($file_name . ".xml", $xml->asXML()); } return $xml; }
function olymp_get_bets(&$tournir_node, $sport_sign, $tournir_id, $debug = null) { $booker = 'olymp'; $host = 'https://www.olympbet.com'; if (file_exists('proxy.txt')) { $proxy = file_get_contents('proxy.txt'); } $league_path = "lines/{$booker}/{$sport_sign}."; $file_name = $league_path . "{$tournir_id}.html"; $url = "{$host}/engine.php?act=co&co={$tournir_id}"; $html = download_or_load($debug, $file_name, $url, "GET", $proxy, "{$host}/{$sport_sign}-odds.html"); extract_bets($tournir_node, $html, $sport_sign, $tournir_id); if ($debug) { file_put_contents($league_path . "{$tournir_id}.xml", $tournir_node->asXML()); } }
<?php require_once "libs/Download.php"; require_once "marathon_xml.php"; $html = download_or_load(0, 'lines/marathon/1.html', 'http://www.marathonbet.com/en/', "GET", ""); print $html; // file_put_contents() // $booker = new marathon_booker(); // $booker->debug = 1; // $sports = $booker->getSports(); // $tournirs = $booker->getTournirs(10); // foreach($tournirs->Tournirs->children() as $element_name=>$child) { // $tournir_id = (string) $child['Id']; // $events = $booker->getEvents(10, $tournir_id, ''); // } // $tournir_id = '749786'; // $events = $booker->getEvents(10, $tournir_id, ''); // print '<xmp>'.$sports->asXml().'</xmp>'; // print '<xmp>'.$tournirs->asXml().'</xmp>';
function bwin_get_bets(&$tournir_node, $sport_sign, $tournir_id, $categories, $debug = null) { $booker = 'bwin'; $host = 'https://www.bwin.com'; if (file_exists('proxy.txt')) { $proxy = file_get_contents('proxy.txt'); } $league_path = "lines/{$booker}/{$sport_sign}."; foreach ($categories as $category_id) { $current_page = 0; do { $current_page++; $file_name = $league_path . "{$tournir_id}.{$category_id}.{$current_page}.html"; $url = "{$host}/betviewiframe.aspx?sorting=leaguedate&categoryIDs={$category_id}&bv=bb&leagueIDs={$tournir_id}"; $html = download_or_load($debug, $file_name, $url, "GET", $proxy, "{$host}/{$sport_sign}?ShowDays=168"); extract_bets($tournir_node, $html, $sport_sign, $tournir_id, $category_id); } while (to_be_continue($html, $current_page + 1)); } if ($debug) { file_put_contents($league_path . "{$tournir_id}.xml", $tournir_node->asXML()); } }