grapper betsapi
This commit is contained in:
1 parent
406fd26864
commit
a3c9f16550
127 files changed
+158128
-650
No files matched your search
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Betsapi;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Event;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Betfair
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
/**
|
||||
* Bet365
|
||||
*/
|
||||
$bookmaker_id = 126;
|
||||
|
||||
$res = Event::where('bet365_id', '>', 0)->pluck('id', 'bet365_id');
|
||||
|
||||
foreach ($res as $bet365_id => $txodds_id) {
|
||||
|
||||
/**
|
||||
* BETFAIR SP (per page)
|
||||
* https://api.b365api.com/v1/bwin/prematch?token=36152-aeTRNnZxSPUwGe
|
||||
*/
|
||||
$url = 'https://api.b365api.com/v4/bet365/prematch?token='.config('env.betsapi_token').'&FI='.$bet365_id;
|
||||
|
||||
$data = Curl::load($url);
|
||||
|
||||
dd($data);
|
||||
|
||||
$betsapi_id = $data['results'][0]['id'] ?? 0;
|
||||
$bet365_id = $data['results'][0]['bet365_id'] ?? 0;
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(["TXdds ID : $txodds_id", "Betsapi ID : $betsapi_id", "Bet365 ID : $bet365_id", "Willhill ID : $willhill_id"], 'b');
|
||||
}
|
||||
|
||||
if ($betsapi_id) {
|
||||
Event::where('id', (int) $txodds_id)->update(['betsapi_id' => $betsapi_id, 'bet365_id' => $bet365_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user