This commit is contained in:
salam committed 2026-08-06 10:43:04 +02:00
1 parent 78917241ad
commit f098ba9b00
18 files changed
+499 -473

No files matched your search

+78 -59
View File
@@ -6,6 +6,7 @@ use App\Console\Commands\Grapper\Sofascore\Grapper;
use App\Console\Commands\Grapper\Sofascore\Helper\SetStorage;
use App\Console\Commands\Grapper\Sofascore\MakeExcel;
use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason;
use App\Console\Commands\Grapper\Sofascore\SendMail;
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
use App\Utilities\Notice;
use Illuminate\Console\Command;
@@ -20,92 +21,110 @@ class Grap extends Command
public static string $folder;
public static $id = 0;
public static string $useragent = '4';
protected $signature = 'grp {id=0} {task=0} {--d} {--r} {--f}';
protected $signature = 'grp {id=0} {day=0} {--folder=} {--d} {--r} {--f}';
public function handle()
{
self::$options = $this->options();
self::$options['task'] = $this->argument('task');
self::$options['id'] = (int) $this->argument('id');
self::$options['day'] = (int) $this->argument('day');
self::$options['base_url'] = 'https://www.sofascore.com/';
$id = $this->argument('id');
if (!$id) {
$txt = 'PARAMETERS' . PHP_EOL;
$txt .= '--d debug' . PHP_EOL;
$txt .= '--r restart range' . PHP_EOL;
$txt .= '--f force' . PHP_EOL;
$txt .= '-----------------------------------------------------------' . PHP_EOL;
$txt .= 'FUNCTION' . PHP_EOL;
$txt .= " 1\tPlayerPerSeason" . PHP_EOL;
$txt .= " 2\tSettingsToLocal" . PHP_EOL;
$txt .= '-----------------------------------------------------------' . PHP_EOL;
$txt .= 'TASK' . PHP_EOL;
$txt .= " 1\tgrapper daily" . PHP_EOL;
$txt .= " 2\tgrapper" . PHP_EOL;
if (! self::$options['id']) {
$txt = 'PARAMETERS'.PHP_EOL;
$txt .= '--d debug'.PHP_EOL;
$txt .= '--r restart range'.PHP_EOL;
$txt .= '--f force'.PHP_EOL;
$txt .= '--folder'.PHP_EOL;
$txt .= '-----------------------------------------------------------'.PHP_EOL;
$txt .= 'FUNCTION'.PHP_EOL;
$txt .= ' 1 grapper daily & subDays ( default 3)'.PHP_EOL;
$txt .= ' 2 grapper date'.PHP_EOL;
$txt .= ' 3 grapper range'.PHP_EOL;
$txt .= ' 4 grapper rose'.PHP_EOL;
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
// $txt .= " 1\tPlayerPerSeason".PHP_EOL;
// $txt .= " 2\tSettingsToLocal".PHP_EOL;
Notice::note($txt, 'b', 1);
}
switch ($id) {
Notice::note('Id '.self::$options['id'], 'bb');
sleep(2);
switch (self::$options['id']) {
case 1:
Notice::note('PlayerPerSeason sleep 5', 'bb');
sleep(5);
// SettingsToLocal::run();
SetStorage::set(1);
// Grapper::load(1);
// MakeExcel::create();
SendMail::run(1);
PlayerPerSeason::run();
break;
// case 2:
// SetStorage::set();
case 2:
Notice::note('SettingsToLocal sleep 5', 'bb');
sleep(5);
// Grapper::load(2);
// break;
// case 3:
// SetStorage::set();
SettingsToLocal::run();
break;
// Grapper::load(3);
// break;
// case 4:
// SetStorage::set();
case 3:
SetStorage::set();
Grapper::load();
break;
// Grapper::load(4);
// break;
// case 5:
case 4:
SetStorage::set();
MakeExcel::create();
break;
// PlayerPerSeason::run();
// break;
// case 'zip':
// self::setStorage();
// ZipFolder::create();
// break;
// case 6:
// case 'mail':
// self::setStorage();
// SendMail::run();
// break;
// SettingsToLocal::run();
// break;
// case 'rose':
// self::setStorage();
// Rose::run();
// break;
// case 7:
// case 'sql_mover':
// SqlMover::run();
// break;
// SetStorage::set();
// MakeExcel::create();
// break;
// case 'zip':
// self::setStorage();
// ZipFolder::create();
// break;
// case 'mail':
// self::setStorage();
// SendMail::run();
// break;
// case 'torunament_teams':
// TournamentTeams::get();
// break;
// case 'rose':
// self::setStorage();
// Rose::run();
// break;
// case 'set_to_production':
// SettingsToProduction::run();
// break;
// case 'sql_mover':
// SqlMover::run();
// break;
// case 'torunament_teams':
// TournamentTeams::get();
// break;
// case 'set_to_production':
// SettingsToProduction::run();
// break;
default:
Notice::note('not a valid fuction', 'br', 1);