popup and grapper wip
This commit is contained in:
1 parent
a3c9f16550
commit
c9588f39b6
18 files changed
+656
-156248
No files matched your search
@@ -17,6 +17,8 @@ class Bwin
|
||||
|
||||
$sportmap = Sport::map('bwin');
|
||||
|
||||
$sportmap = [4];
|
||||
|
||||
$total = 1;
|
||||
foreach ($sportmap as $sport_id => $bwin_sport_id) {
|
||||
|
||||
@@ -25,28 +27,32 @@ class Bwin
|
||||
/**
|
||||
* BWIN ODDS & BETRADAR ID (per page)
|
||||
*/
|
||||
$url = 'https://api.b365api.com/v1/bwin/prematch?token='.config('env.betsapi_token').'&page=###page###&sport_id='.$bwin_sport_id;
|
||||
$base_url = 'https://api.b365api.com/v1/bwin/prematch?token='.config('env.betsapi_token').'&skip_markets=1&page=###page###&sport_id='.$bwin_sport_id;
|
||||
|
||||
while ($page <= $total) {
|
||||
|
||||
$url = str_replace('###page###', $page, $url);
|
||||
$url = str_replace('###page###', $page, $base_url);
|
||||
|
||||
$data = Curl::load($url);
|
||||
|
||||
$page++;
|
||||
|
||||
$total = round($data['pager']['total'] / $data['pager']['per_page']);
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("Page: $page \nTotal: $total");
|
||||
}
|
||||
|
||||
$page++;
|
||||
|
||||
if (isset($data['results'])) {
|
||||
foreach ($data['results'] as $event) {
|
||||
|
||||
$bwin_id = $event['Id'];
|
||||
$betsapi_id = $event['our_event_id'] ?? 0;
|
||||
$betradar_id = $event['BetRadarId'] ?? 0;
|
||||
$betsapi_id = $event['our_event_id'];
|
||||
$bwin_id = $event['Id'] ?? 0;
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(["Betsapi ID : $betsapi_id", "Betradar ID : $betradar_id", "Bwin ID : $bwin_id"]);
|
||||
}
|
||||
|
||||
if ($betradar_id) {
|
||||
Event::where('betsapi_id', (int) $betsapi_id)->update(['betradar_id' => $betradar_id, 'bwin_id' => $bwin_id]);
|
||||
|
||||
Reference in new issue
Block a user