ADD GRAPPER BETICA GOLDBET WIP

This commit is contained in:
salam committed 2026-01-15 16:14:10 +01:00
1 parent 9cf4b5ffd1
commit 128d3e5d99
7 files changed
+131 -28

No files matched your search

@@ -0,0 +1,34 @@
<?php
namespace App\Console\Commands\Services\Tasks;
use App\Console\Commands\Nuh;
use App\Console\Commands\Xml;
use App\Models\TxoddsMarket;
use App\Utilities\Notice;
class CallTxoddsMarkets
{
public static function call()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note('TxoddsMarkets', 'b');
}
$url = 'https://xml2.txodds.com/feed/odds_types.php';
$data = Xml::load($url);
foreach ($data as $row) {
$market = [
'shortname' => $row->sname,
'name' => (string) $row->name,
];
TxoddsMarket::updateOrCreate(['market_id' => (int) $row->ot], $market);
}
}
}
@@ -0,0 +1,53 @@
<?php
namespace App\Console\Commands\Services\Tasks\Helper;
class ExplodeElement
{
public static function grap($str)
{
$tmp = str_replace(',', ' ', $str);
// $tmp = str_replace('-', ' ', $tmp);
$tmp = str_replace('/', ' ', $tmp);
$tmp = preg_replace('"\([^\)]*\)"', '', $tmp);
$tmp = preg_replace('/[^a-zA-Z0-9 ] /', '', $tmp);
$tmp = str_replace(' ', ' ', $tmp);
$elements = explode(' ', $tmp);
$_return = [];
foreach ($elements as $value) {
if (\strlen($value) > 2) {
$_return[] = $value;
}
}
usort($_return, function ($a, $b) {
return strlen($b) <=> strlen($a);
});
$remove = [
'fc',
'city',
'new',
'real',
'united',
'dinamo',
'town',
'club',
'union',
'sport',
'sports',
'basket',
'hapoel',
'maccabi',
'east'];
return array_diff($_return, $remove);
}
}
@@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands\Services\Tasks;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
class Mapper
{
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
switch (Nuh::$options['sport_id']) {
case 1:
$bookmakers = [10, 14, 16, 35, 36, 46, 128];
break;
case 2:
$bookmakers = [10, 16, 35, 36, 46, 128];
break;
case 3:
$bookmakers = [128, 10, 16, 35, 36, 46];
break;
case 5:
$bookmakers = [128, 10, 16, 35, 36, 46];
break;
}
if ($debug) {
Notice::note('MAPPER SOCCER', 'g');
}
$results = [];
foreach ($bookmakers as $$bookmaker_id) {
// code...
}
}
}