From f5fc9373118d725f5d8e79660297ebcbc2b35bb2 Mon Sep 17 00:00:00 2001 From: salam Date: Tue, 27 Jan 2026 11:44:32 +0100 Subject: [PATCH] wip --- app/Console/Commands/Grapper/TxOdds/Odds.php | 2 +- app/Console/Commands/Services/Services.php | 20 ++-- .../{AlarmGenerator.php => GenerateAlarm.php} | 2 +- ...DefaultSetting.php => GenerateSetting.php} | 2 +- ...{CallTxoddsMarkets.php => MarketsList.php} | 2 +- .../Commands/Services/Tasks/MarketsState.php | 112 ++++++++++++++++++ .../Supervisors/Tables/SupervisorsTable.php | 7 +- database/seeders/SupervisorSeeder.php | 12 +- todo.md | 21 ++-- 9 files changed, 152 insertions(+), 28 deletions(-) rename app/Console/Commands/Services/Tasks/{AlarmGenerator.php => GenerateAlarm.php} (98%) rename app/Console/Commands/Services/Tasks/{GenerateDefaultSetting.php => GenerateSetting.php} (99%) rename app/Console/Commands/Services/Tasks/{CallTxoddsMarkets.php => MarketsList.php} (96%) create mode 100644 app/Console/Commands/Services/Tasks/MarketsState.php diff --git a/app/Console/Commands/Grapper/TxOdds/Odds.php b/app/Console/Commands/Grapper/TxOdds/Odds.php index ed8b026e..e5452ef2 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds.php @@ -66,7 +66,7 @@ class Odds } /************************************************* - * use_lastcall + * markets *************************************************/ $markets = '&ot='.implode(',', $res); diff --git a/app/Console/Commands/Services/Services.php b/app/Console/Commands/Services/Services.php index d2dc76b5..8a759dc3 100644 --- a/app/Console/Commands/Services/Services.php +++ b/app/Console/Commands/Services/Services.php @@ -3,10 +3,11 @@ namespace App\Console\Commands\Services; use App\Console\Commands\Nuh; -use App\Console\Commands\Services\Tasks\AlarmGenerator; -use App\Console\Commands\Services\Tasks\CallTxoddsMarkets; use App\Console\Commands\Services\Tasks\DBMapper; -use App\Console\Commands\Services\Tasks\GenerateDefaultSetting; +use App\Console\Commands\Services\Tasks\GenerateAlarm; +use App\Console\Commands\Services\Tasks\GenerateSetting; +use App\Console\Commands\Services\Tasks\MarketsList; +use App\Console\Commands\Services\Tasks\MarketsState; class Services { @@ -14,16 +15,19 @@ class Services { switch (Nuh::$options['name']) { case 'Txodds Markets': - CallTxoddsMarkets::call(); + MarketsList::call(); + break; + case 'Txodds Offerstatus': + MarketsState::call(); break; case 'DB Mapper': DBMapper::run(); break; - case 'Generate Default Setting': - GenerateDefaultSetting::run(); + case 'Generate Setting': + GenerateSetting::run(); break; - case 'Alarm Generator': - AlarmGenerator::run(); + case 'Generate Alarm': + GenerateAlarm::run(); break; } diff --git a/app/Console/Commands/Services/Tasks/AlarmGenerator.php b/app/Console/Commands/Services/Tasks/GenerateAlarm.php similarity index 98% rename from app/Console/Commands/Services/Tasks/AlarmGenerator.php rename to app/Console/Commands/Services/Tasks/GenerateAlarm.php index 179de036..8730b33b 100644 --- a/app/Console/Commands/Services/Tasks/AlarmGenerator.php +++ b/app/Console/Commands/Services/Tasks/GenerateAlarm.php @@ -14,7 +14,7 @@ use App\Models\Client; use App\Models\EventBookmaker; use App\Utilities\Notice; -class AlarmGenerator +class GenerateAlarm { public static function run() { diff --git a/app/Console/Commands/Services/Tasks/GenerateDefaultSetting.php b/app/Console/Commands/Services/Tasks/GenerateSetting.php similarity index 99% rename from app/Console/Commands/Services/Tasks/GenerateDefaultSetting.php rename to app/Console/Commands/Services/Tasks/GenerateSetting.php index 254947f1..37de27b5 100644 --- a/app/Console/Commands/Services/Tasks/GenerateDefaultSetting.php +++ b/app/Console/Commands/Services/Tasks/GenerateSetting.php @@ -14,7 +14,7 @@ use App\Models\Sport; use App\Models\User; use App\Utilities\Notice; -class GenerateDefaultSetting +class GenerateSetting { public static function run() { diff --git a/app/Console/Commands/Services/Tasks/CallTxoddsMarkets.php b/app/Console/Commands/Services/Tasks/MarketsList.php similarity index 96% rename from app/Console/Commands/Services/Tasks/CallTxoddsMarkets.php rename to app/Console/Commands/Services/Tasks/MarketsList.php index 2fd4b7cb..855a4329 100644 --- a/app/Console/Commands/Services/Tasks/CallTxoddsMarkets.php +++ b/app/Console/Commands/Services/Tasks/MarketsList.php @@ -7,7 +7,7 @@ use App\Console\Commands\Xml; use App\Models\TxoddsMarket; use App\Utilities\Notice; -class CallTxoddsMarkets +class MarketsList { public static function call() { diff --git a/app/Console/Commands/Services/Tasks/MarketsState.php b/app/Console/Commands/Services/Tasks/MarketsState.php new file mode 100644 index 00000000..00e98660 --- /dev/null +++ b/app/Console/Commands/Services/Tasks/MarketsState.php @@ -0,0 +1,112 @@ +update(['lastcall' => time()]); + + // if (Txodds::$_config['soccer-others'] == 'soccer') { + // $lc_file = '/var/www/NuhOdds/src/Txodds/Lastcalls/flags_soccer.txt'; + // $lastcall = file_get_contents($lc_file); + // $url = "https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=$lastcall"; + // } elseif (Txodds::$_config['soccer-others'] == 'others') { + // $lc_file = '/var/www/NuhOdds/src/Txodds/Lastcalls/flags_other.txt'; + // $lastcall = file_get_contents($lc_file); + // $url = "https://xml2.txodds.com/feed/boid_states.php?ident=betaid2&passwd=Dy59vpRC&last=$lastcall"; + // } + + // if ($lastcall < time() + 60) { + // $lastcall = time() - 60; + // } + + // if (Database::$debug == 1) { + // echo Utilities::note($url); + // } + + // $xml = Loader::xmlLoader($url); + + // file_put_contents($lc_file, (int) $xml['timestamp']); + + // $_status = []; + + // foreach ($xml->boid as $_boid) { + // $offerid = (int) $_boid['id']; + // $flags = (int) $_boid['flags']; + + // $_status[$offerid] = $flags; + // } + + // $_tables = ['bai_3way', 'bai_2way', 'bai_totals', 'bai_totals_ht', 'bai_totals_qt', 'bai_points', 'bai_points_ht', 'bai_points_qt']; + + // foreach ($_tables as $key => $table) { + // if (Txodds::$_config['soccer-others'] == 'soccer') { + // $tmp = DbFunction::select($table, ['offerid', 'flags'], ['AND' => ['orig' => 0, 'sportid' => 1]]); + // } elseif (Txodds::$_config['soccer-others'] == 'others') { + // $tmp = DbFunction::select($table, ['offerid', 'flags'], ['AND' => ['orig' => 0, 'sportid[!]' => 1]]); + // } + + // // foreach ($tmp as $key => $value) { + // // $offerid = $value["offerid"]; + // // $flags = $value["flags"]; + // // if (isset($_status[$offerid])) { + // // DbFunction::secureUpdate($table, ["flags"=>$flags], ["offerid"=>$offerid]); + // // } + // // } + + // foreach ($tmp as $key => $value) { + // $offerid = $value['offerid']; + // $old_flags = $value['flags']; + // if (isset($_status[$offerid])) { + // if ($_status[$offerid] == 1) { + // if ($old_flags == 0) { + // DbFunction::secureUpdate($table, ['flags' => 1], ['offerid' => $offerid]); + // } + // } else { + // if ($old_flags == 1) { + // DbFunction::secureUpdate($table, ['flags' => 0], ['offerid' => $offerid]); + // } + // } + // } + // } + // } + } +} diff --git a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php index 780578c9..cf9de3cc 100644 --- a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php +++ b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php @@ -74,9 +74,10 @@ class SupervisorsTable */ return [ 'Txodds Markets' => 'Txodds Markets', + 'Txodds Offerstatus' => 'Txodds Offerstatus', 'DB Mapper' => 'DB Mapper', - 'Generate Default Setting' => 'Generate Default Setting', - 'Alarm Generator' => 'Alarm Generator', + 'Generate Setting' => 'Generate Setting', + 'Generate Alarms' => 'Generate Alarms', ]; case 9: case 10: @@ -110,7 +111,7 @@ class SupervisorsTable ])->space(3), Stack::make([ - TextInputColumn::make('days_from')->prefix('Days Fm') + TextInputColumn::make('days_from')->prefix('Days Fr') ->hidden(function (ListSupervisors $livewire) { return $livewire->tableFilters['provider_id']['value'] == 8; }), diff --git a/database/seeders/SupervisorSeeder.php b/database/seeders/SupervisorSeeder.php index 44fecd5f..87f35893 100644 --- a/database/seeders/SupervisorSeeder.php +++ b/database/seeders/SupervisorSeeder.php @@ -14,8 +14,8 @@ class SupervisorSeeder extends Seeder */ $sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `txodds_market_id`, `sleep`, `limit`, `runtime`, `commandline_options`, `maxsconds`, `lastcall`, `use_lastcall`, `is_supervisor`, `is_active`, `days_from`, `days_to`, `created_at`, `updated_at`) VALUES - (1, 'Fixtures', 1, NULL, NULL, 10, 0, '0', NULL, 1800, 0, 0, 0, 0, 0, 30, '2025-08-27 07:39:55', '2026-01-19 04:18:53'), - (2, 'Odds', 1, 1, NULL, 10, 0, '2.997', NULL, 30, 0, 0, 1, 0, 0, 10, '2025-12-01 05:41:02', '2026-01-19 04:17:02'), + (1, 'Fixtures', 1, NULL, NULL, 10, 0, '0.279', NULL, 1800, 0, 0, 0, 0, 0, 30, '2025-08-27 07:39:55', '2026-01-27 09:34:20'), + (2, 'Odds', 1, 1, NULL, 10, 0, '2.912', NULL, 30, 0, 0, 1, 0, 0, 10, '2025-12-01 05:41:02', '2026-01-27 09:37:32'), (3, 'Fixtures', 2, 0, NULL, 15, 0, '0.266', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:42:35', '2026-01-16 09:34:05'), (4, 'Willhill', 2, 0, NULL, 15, 0, '0.842', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:48:05', '2026-01-16 09:34:57'), (5, 'Bwin', 2, 0, NULL, 15, 0, '0.278', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-22 06:41:18', '2026-01-16 09:35:14'), @@ -37,7 +37,7 @@ class SupervisorSeeder extends Seeder (21, 'Odds', 1, 2, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 10, '2026-01-08 17:57:14', '2026-01-14 15:52:43'), (22, 'Odds', 1, 5, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 10, '2026-01-08 17:57:24', '2026-01-14 15:52:44'), (23, 'DB Mapper', 7, NULL, NULL, 15, 0, '0.006', NULL, 1800, 0, 0, 0, 0, 0, 0, '2026-01-13 05:55:30', '2026-01-19 04:17:21'), - (24, '', 8, 1, 0, 30, 0, '0.067', NULL, 30, 1768405759, 0, 1, 0, 10, 10, '2026-01-14 15:42:40', '2026-01-14 17:22:36'), + (24, '', 8, 2, 0, 30, 0, '0.067', NULL, 30, 1768405759, 0, 1, 0, 10, 10, '2026-01-14 15:42:40', '2026-01-27 10:28:17'), (25, '', 8, 1, 4, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:25', '2026-01-14 17:20:08'), (26, '', 8, 1, 65536, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:28', '2026-01-14 17:20:08'), (27, '', 8, 1, 65540, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:31', '2026-01-14 17:20:08'), @@ -66,8 +66,10 @@ class SupervisorSeeder extends Seeder (50, '', 8, 5, 131073, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:16', '2026-01-14 17:41:25'), (51, '', 9, 1, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14'), (52, '', 10, 0, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14'), - (53, 'Generate Default Setting', 7, 0, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14'), - (54, 'Alarm Generator', 7, 1, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14');"; + (53, 'Generate Default Setting', 7, 0, NULL, 30, 0, '0.017', NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-27 11:23:00'), + (54, 'Generate Alarms', 7, 1, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-27 11:25:41'), + (55, 'Txodds Offerstatus', 7, NULL, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-27 11:25:56', '2026-01-27 11:26:05'); +"; DB::unprepared($sql); } diff --git a/todo.md b/todo.md index b948e89a..56ec6976 100644 --- a/todo.md +++ b/todo.md @@ -11,12 +11,17 @@ - [ ] txdds inactive and closed events feeds - [ ] txdds bookmaker flags -- [x] find fixture -- [x] stars in frontend -- [x] txodds last call -- [x] logifuture production grapper -- [x] Event Filter Indicators and reset button -- [x] country icons in prod not showing +[PDF] +https://txodds.com/docs/TXODDS_TXAPI_Market_Odds_Feed_User_Guide.pdf -Alarm -https://github.com/5balloons/livewire-tooltip \ No newline at end of file +Appendix 4 - Deleted bet offers web service +https://xml2.txodds.com/feed/deleted_boids.php?ident=betaid1&passwd=Dy59vpRC + +Appendix 5 - Deleted matches web service +https://xml2.txodds.com/feed/deleted_peids.php?ident=betaid1&passwd=Dy59vpRC + +Bookmakers Starting Times +https://txodds.com/feed/starting_times.php?ident=betaid1&passwd=Dy59vpRC&date=today + +Tracking OTB (Off-the-board) Offers +https://xml2.txodds.com/feed/boid_states.php?ident=betaid1&passwd=Dy59vpRC&last=1769508445 \ No newline at end of file