Files
nuhodds_fi4/app/Console/Commands/Grap.php
T
2026-08-06 15:47:30 +02:00

144 lines
4.0 KiB
PHP

<?php
namespace App\Console\Commands;
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;
class Grap extends Command
{
public static $options = [];
public static string $storage;
public static string $zipfile;
public static string $folder;
public static string $useragent = '4';
protected $signature = 'grp {id=0} {day=0} {--folder=} {--d} {--r} {--f}';
public function handle()
{
self::$options = $this->options();
self::$options['id'] = (int) $this->argument('id');
self::$options['day'] = (int) $this->argument('day');
self::$options['base_url'] = 'https://www.sofascore.com/';
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 .= ' 5 make ecxel from folder' . PHP_EOL;
$txt .= ' 5 playeer/season' . 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);
}
Notice::note('Id ' . self::$options['id'], 'bb');
sleep(2);
switch (self::$options['id']) {
case 1:
SettingsToLocal::run();
SetStorage::set(1);
Grapper::load(1);
MakeExcel::create();
SendMail::run(1);
break;
case 5:
SetStorage::set(5);
MakeExcel::create();
break;
case 6:
PlayerPerSeason::run();
break;
// case 2:
// SetStorage::set();
// Grapper::load(2);
// break;
// case 3:
// SetStorage::set();
// Grapper::load(3);
// break;
// case 4:
// SetStorage::set();
// Grapper::load(4);
// break;
// case 5:
// PlayerPerSeason::run();
// break;
// case 6:
// SettingsToLocal::run();
// break;
// case 7:
// SetStorage::set();
// MakeExcel::create();
// break;
// case 'zip':
// self::setStorage();
// ZipFolder::create();
// break;
// case 'mail':
// self::setStorage();
// SendMail::run();
// break;
// case 'rose':
// self::setStorage();
// Rose::run();
// break;
// case 'sql_mover':
// SqlMover::run();
// break;
// case 'torunament_teams':
// TournamentTeams::get();
// break;
// case 'set_to_production':
// SettingsToProduction::run();
// break;
default:
Notice::note('function not implemented yet', 'br', 1);
}
}
}