logifuture
This commit is contained in:
1 parent
91ec9d11cc
commit
0e34020a01
22 files changed
+546
-442
No files matched your search
@@ -2,10 +2,18 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper;
|
||||
|
||||
use App\Console\Commands\Grapper\Logifuture\ActiveEvent;
|
||||
use App\Console\Commands\Grapper\Logifuture\Auth;
|
||||
use App\Console\Commands\Grapper\Logifuture\BaseUrl;
|
||||
use App\Console\Commands\Grapper\Logifuture\Basketball;
|
||||
use App\Console\Commands\Grapper\Logifuture\Icehockey;
|
||||
use App\Console\Commands\Grapper\Logifuture\MapEvent;
|
||||
use App\Console\Commands\Grapper\Logifuture\Soccer;
|
||||
use App\Console\Commands\Grapper\Logifuture\Tennis;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Mapper\FindFixture;
|
||||
use App\Mapper\LoadElements;
|
||||
use App\Mapper\LoadGroups;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
@@ -15,8 +23,14 @@ class Logifuture
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$_elements = LoadElements::load(Nuh::$options['provider_id'], true);
|
||||
|
||||
$_groups = LoadGroups::load(Nuh::$options['provider_id'], true);
|
||||
|
||||
$sportmap = Sport::map('logi', 1, [1, 2, 3, 5]);
|
||||
|
||||
$event_id_collector = [];
|
||||
|
||||
if ($debug) {
|
||||
Notice::note(Nuh::$options['provider']['name'].' '.Nuh::$options['sport']['name'], 'g');
|
||||
}
|
||||
@@ -30,29 +44,37 @@ class Logifuture
|
||||
break;
|
||||
}
|
||||
|
||||
// https://external-api.bet9ja.com/external/v1/matches?sport_id=1
|
||||
// https://external-api.bet9ja.com/external
|
||||
|
||||
$data = Auth::exe();
|
||||
|
||||
foreach ($sportmap as $client_sportid => $sportid) {
|
||||
$header = [];
|
||||
$header[] = 'Authorization: Bearer '.$data['token'];
|
||||
$header[] = 'accept: application/json';
|
||||
$header[] = 'content-type: application/json';
|
||||
|
||||
foreach ($sportmap as $client_sport_id => $sport_id) {
|
||||
$post_fields = [
|
||||
'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sportid,
|
||||
'header' => json_encode(['Authorization: Bearer '.$data['token'], 'accept: application/json', 'content-type: application/json']),
|
||||
'url' => BaseUrl::get().'/v1/matches?sportId='.$client_sport_id,
|
||||
'header' => json_encode($header),
|
||||
];
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, 'https://proxydb1.nuhodds.com/logifuture.php');
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||
'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx',
|
||||
]);
|
||||
|
||||
$file = curl_exec($ch);
|
||||
|
||||
$matches = json_decode($file, 1);
|
||||
|
||||
if (! isset($matches['error'])) {
|
||||
@@ -61,72 +83,47 @@ class Logifuture
|
||||
|
||||
if (strpos($match['sportCategory'], 'Simulated Reality') === false) {
|
||||
|
||||
$event = ActiveEvent::filter($sportid, $match);
|
||||
$event = MapEvent::filter($sport_id, $match);
|
||||
|
||||
dd($event);
|
||||
FindFixture::search($event, $_groups[$sport_id], $_elements[$sport_id], true);
|
||||
|
||||
$_spreads = [];
|
||||
switch ($sportid) {
|
||||
case 1:
|
||||
Soccer::get($event, $match);
|
||||
break;
|
||||
case 2:
|
||||
Icehockey::get($event, $_spreads, $match);
|
||||
break;
|
||||
case 3:
|
||||
Basket::get($event, $_spreads, $match);
|
||||
break;
|
||||
case 5:
|
||||
Tennis::get($event, $_spreads, $match);
|
||||
break;
|
||||
if ($event['id']) {
|
||||
|
||||
default:
|
||||
Notice::note('SPORT NOT IMPLEMENTED', 'r', 1);
|
||||
break;
|
||||
}
|
||||
$event_id_collector[] = $event['id'];
|
||||
|
||||
Parser::$_matches_array = [];
|
||||
Parser::$_matches_array[] = $event;
|
||||
EventBookmaker::updateOrCreate([
|
||||
'event_id' => $event['id'],
|
||||
'bookmaker_id' => Nuh::$options['bookmaker_id'],
|
||||
], ['in_feed' => 1, 'bmoid' => $event['event_id']]);
|
||||
|
||||
$matchid = Parser::processData(1);
|
||||
$_spreads = [];
|
||||
switch ($sport_id) {
|
||||
case 1:
|
||||
Soccer::get($event, $match);
|
||||
break;
|
||||
case 2:
|
||||
Icehockey::get($event, $_spreads, $match);
|
||||
break;
|
||||
case 3:
|
||||
Basketball::get($event, $_spreads, $match);
|
||||
break;
|
||||
case 5:
|
||||
Tennis::get($event, $_spreads, $match);
|
||||
break;
|
||||
|
||||
if ($matchid) {
|
||||
|
||||
$event['matchid'] = $matchid;
|
||||
|
||||
if (isset($_spreads['point'])) {
|
||||
$tmp = $event + $_spreads['point'];
|
||||
DB_Parser::addPointOdds('bai_points', $matchid, $tmp);
|
||||
}
|
||||
|
||||
if (isset($_spreads['point_qt'])) {
|
||||
$tmp = $event + $_spreads['point_qt'];
|
||||
DB_Parser::addPointOdds('bai_points_qt', $matchid, $tmp);
|
||||
}
|
||||
|
||||
if (isset($_spreads['total'])) {
|
||||
$tmp = $event + $_spreads['total'];
|
||||
DB_Parser::addTotalOdds('bai_totals', $matchid, $tmp);
|
||||
}
|
||||
|
||||
if (isset($_spreads['total_qt'])) {
|
||||
$tmp = $event + $_spreads['total_qt'];
|
||||
DB_Parser::addTotalOdds('bai_totals_qt', $matchid, $tmp);
|
||||
}
|
||||
|
||||
if (isset($_spreads['mlset1'])) {
|
||||
$tmp = $event + $_spreads['mlset1'];
|
||||
DB_Parser::addTotalOdds('bai_2way_set1', $matchid, $tmp);
|
||||
}
|
||||
|
||||
if (Database::$debug) {
|
||||
Notice::note($event, 'y');
|
||||
default:
|
||||
Notice::note('SPORT NOT IMPLEMENTED', 'r', 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Parser::flagStatus($sportid);
|
||||
|
||||
}
|
||||
}
|
||||
if ($event_id_collector) {
|
||||
EventBookmaker::whereNotIn('event_id', $event_id_collector)->where('bookmaker_id', Nuh::$options['bookmaker_id'])->update(['in_feed' => 0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user