This commit is contained in:
salam committed 2026-08-03 09:32:32 +02:00
1 parent 86115ac9e8
commit a85ac159de
3 files changed
+31 -36

No files matched your search

+3 -6
View File
@@ -26,7 +26,7 @@ class Sofascore
public static string $zipfile; public static string $zipfile;
public static string $excel_name; public static string $folder;
public static string $useragent = '4'; public static string $useragent = '4';
@@ -101,8 +101,8 @@ class Sofascore
switch ($task->id) { switch ($task->id) {
case 1: case 1:
self::$storage = $sofascore_data . $storage_name . '/' . Carbon::now()->subDays(3)->format('Y-m-d'); self::$storage = $sofascore_data . $storage_name;
self::$zipfile = $sofascore_data . $storage_name . '/' . Carbon::now()->subDays(3)->format('Y-m-d') . '.zip'; self::$folder = Carbon::now()->subDays(3)->format('Y-m-d');
break; break;
case 2: case 2:
self::$storage = $sofascore_data . $storage_name . '/' . $task->day_from; self::$storage = $sofascore_data . $storage_name . '/' . $task->day_from;
@@ -122,8 +122,5 @@ class Sofascore
self::$zipfile = $sofascore_data . $storage_name . '/archive.zip'; self::$zipfile = $sofascore_data . $storage_name . '/archive.zip';
break; break;
} }
if ($debug)
Notice::note("\nStore:\t" . Sofascore::$storage . "\nZip:\t" . Sofascore::$zipfile, 'c');
} }
} }
@@ -6,13 +6,13 @@ use App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Grapper\Sofascore\Helper\ZipFolder; use App\Console\Commands\Grapper\Sofascore\Helper\ZipFolder;
use App\Console\Commands\Nuh; use App\Console\Commands\Nuh;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Carbon;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
class MakeExcel class MakeExcel
{ {
public static $FOLDER = 'Season-25-26-Major-Leagues'; public static $max = 1000;
public static $MAXCOLUMNS = 1000;
public static function create() public static function create()
{ {
@@ -21,21 +21,17 @@ class MakeExcel
$debug = Nuh::$options['d'] ?? 0; $debug = Nuh::$options['d'] ?? 0;
if ($debug) { if ($debug) {
Notice::note("Make Excel", 'bb'); Notice::note("Make Excel folder to import: " . Sofascore::$folder . "\nmaximum files in excel: " . self::$max, 'b');
}
if ($debug) {
Notice::note("Folder to Import: " . self::$FOLDER . "\nMaximum in Excel: " . self::$MAXCOLUMNS, 'b');
} }
$files = self::load_files(); $files = self::load_files();
foreach ($files as $key => $value) { foreach ($files as $key => $value) {
$from = $key * self::$MAXCOLUMNS + 1; $from = $key * self::$max + 1;
$key++; $key++;
$to = $key * self::$MAXCOLUMNS; $to = $key * self::$max;
$filename = self::$FOLDER . '-' . $from . '-' . $to . '.xlsx'; $filename = Sofascore::$folder . '-' . $from . '-' . $to . '.xlsx';
$spreadsheet = new Spreadsheet; $spreadsheet = new Spreadsheet;
$spreadsheet->getProperties()->setTitle($filename); $spreadsheet->getProperties()->setTitle($filename);
@@ -65,7 +61,7 @@ class MakeExcel
public static function load_files() public static function load_files()
{ {
$files = ZipFolder::get_tree(Sofascore::$storage . '/' . self::$FOLDER); $files = ZipFolder::get_tree(Sofascore::$storage . '/' . Sofascore::$folder);
$filtered = []; $filtered = [];
foreach ($files as $file) { foreach ($files as $file) {
@@ -74,7 +70,6 @@ class MakeExcel
$filtered[] = $file; $filtered[] = $file;
} }
} }
return array_chunk($filtered, self::$max);
return array_chunk($filtered, self::$MAXCOLUMNS);
} }
} }
+20 -17
View File
@@ -10,28 +10,31 @@ case "$1" in
echo "\n--------------------------" echo "\n--------------------------"
echo "5 sec to stop" echo "5 sec to stop"
echo "--------------------------" echo "--------------------------"
sleep 5 # sleep 5
echo "\n⚽ close all vpn" # echo "\n⚽ close all vpn"
killall ssh # killall ssh
echo "\n⚽ open vpn" # echo "\n⚽ open vpn"
ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 # ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
echo "\n⚽ Settings To Local" # echo "\n⚽ Settings To Local"
php artisan nuh --d --f 67 --fun=2 --task=0 # php artisan nuh --d --f 67 --fun=2 --task=0
echo "\n⚽ close vpn" # echo "\n⚽ close vpn"
killall ssh # killall ssh
echo "\n⚽ Grapper" # echo "\n⚽ Grapper"
php artisan nuh --d --f --ff 67 --fun=3 --task=1 # php artisan nuh --d --f --ff 67 --fun=3 --task=1
echo "\n⚽ CreateZip" # echo "\n⚽ Create Zip"
php artisan nuh --d --f 67 --fun=4 --task=1 # php artisan nuh --d --f 67 --fun=4 --task=1
echo "\n⚽ SendMail" echo "\n⚽ Excel Import"
php artisan nuh --d --f 67 --fun=5 --task=1 php artisan nuh --d --f 67 --fun=8 --task=1
# echo "\n⚽ SendMail"
# php artisan nuh --d --f 67 --fun=5 --task=1
echo "\n😎 task done :)" echo "\n😎 task done :)"
echo "" echo ""
@@ -108,7 +111,7 @@ case "$1" in
echo "" echo ""
echo "\033[1;35m"; echo "\033[1;35m";
echo "--------------------------" echo "--------------------------"
echo "Task: 5 ⚽ Rooster" echo "Task: 5 ⚽ Roster"
echo "--------------------------" echo "--------------------------"
echo "\033[0;0m"; echo "\033[0;0m";
@@ -192,7 +195,7 @@ case "$1" in
echo "\033[1;34m"; echo "\033[1;34m";
echo "Task: 4 ⚽ Tornament" echo "Task: 4 ⚽ Tornament"
echo "\033[1;35m"; echo "\033[1;35m";
echo "Task: 5 ⚽ Rooster" echo "Task: 5 ⚽ Roster"
echo "\033[1;36m"; echo "\033[1;36m";
echo "Task: 6 ⚽ Copy to DEV" echo "Task: 6 ⚽ Copy to DEV"
echo "\033[1;36m"; echo "\033[1;36m";