From 1890b1fcc2b85c425a9bf723c0c0898cbecb3b1e Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 22 Jul 2026 08:58:44 +0200 Subject: [PATCH] wip --- .../Commands/Grapper/Sofascore/Grapper.php | 4 ++- .../Grapper/Sofascore/Helper/LoadDays.php | 2 +- .../Schemas/SofaScoreTaskForm.php | 1 - grapper.sh => grapper/grap1.sh | 25 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) rename grapper.sh => grapper/grap1.sh (64%) diff --git a/app/Console/Commands/Grapper/Sofascore/Grapper.php b/app/Console/Commands/Grapper/Sofascore/Grapper.php index 6a30dad3..18189115 100644 --- a/app/Console/Commands/Grapper/Sofascore/Grapper.php +++ b/app/Console/Commands/Grapper/Sofascore/Grapper.php @@ -21,6 +21,8 @@ class Grapper { $debug = Nuh::$options['d'] ?? 0; + $force = Nuh::$options['f'] ?? 0; + $task_id = Nuh::$options['task'] ?? 0; $restart = Nuh::$options['restart'] ?? 0; @@ -84,7 +86,7 @@ class Grapper foreach ($data['events'] as $event) { - if (SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) { + if (!$force && SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) { if ($debug) { Notice::note('Grapped ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g'); } diff --git a/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php b/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php index 00890783..cc42244e 100644 --- a/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php +++ b/app/Console/Commands/Grapper/Sofascore/Helper/LoadDays.php @@ -35,7 +35,7 @@ class LoadDays case 'daily': $dates[] = [ - 'day' => Carbon::now()->subDay()->format('Y-m-d'), + 'day' => Carbon::now()->subDays(3)->format('Y-m-d'), 'slug' => $task->sport->ss_slug, 'sport_id' => $task->sport_id, ]; diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php index 1aac95ba..255e0c4b 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php @@ -14,7 +14,6 @@ class SofaScoreTaskForm public static function configure(Schema $schema): Schema { return $schema - ->columns(5) ->components([ TextInput::make('name') ->required(), diff --git a/grapper.sh b/grapper/grap1.sh similarity index 64% rename from grapper.sh rename to grapper/grap1.sh index 4da44444..5427fea9 100755 --- a/grapper.sh +++ b/grapper/grap1.sh @@ -5,11 +5,10 @@ case "$1" in echo "GRAPPER SOFASCORE" echo "--------------------------" echo "parameter ID" - echo "--fun = Sofascore.php switch() " echo "--task = sofa_score_tasks_id" - echo "daily 1" - echo "dates 2" + echo "--restart = [0|1]" echo "--------------------------" + echo "--fun = Sofascore.php switch() " echo "SELECT liga, name, starttime FROM sofa_score_event_grappeds WHERE grapper_id = 1;" echo "" exit 1 @@ -19,23 +18,23 @@ case "$1" in echo "\n⚽ sofa_score_task $1" - echo "\n⚽ close all vpn" - killall ssh + # echo "\n⚽ close all vpn" + # killall ssh - echo "\n⚽ open vpn" - ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 + # echo "\n⚽ open vpn" + # ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 - echo "\n⚽ Settings To Local" - php artisan nuh --d --f 67 --fun=2 --task=$1 + # echo "\n⚽ Settings To Local" + # php artisan nuh --d --f 67 --fun=2 --task=$1 - echo "\n⚽ close vpn" - killall ssh + # echo "\n⚽ close vpn" + # killall ssh echo "\n⚽ Grapper" php artisan nuh --d --f 67 --fun=3 --task=$1 --restart=$2 - echo "\n⚽ CreateZip" - php artisan nuh --d --f 67 --fun=4 --task=$1 + # echo "\n⚽ CreateZip" + # php artisan nuh --d --f 67 --fun=4 --task=$1 # echo "\n⚽ SendMail" # php artisan nuh --d --f 67 --fun=5 --task=$1