wip
This commit is contained in:
1 parent
31dd27dd73
commit
254ca94d73
4 files changed
+80
-237
No files matched your search
@@ -70,7 +70,7 @@ trait GrapSofascore
|
||||
|
||||
case 'range':
|
||||
$this->task_id = 3;
|
||||
$this->run_range($grapperSelected);
|
||||
$this->range_grapper_nobreak();
|
||||
break;
|
||||
|
||||
case 'settings':
|
||||
@@ -91,6 +91,10 @@ trait GrapSofascore
|
||||
|
||||
$this->clear_folder($folder);
|
||||
break;
|
||||
|
||||
case 'delete_orphants':
|
||||
$this->delete_imported_files_orphants();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -116,17 +120,17 @@ trait GrapSofascore
|
||||
/**
|
||||
* day 1
|
||||
*/
|
||||
// $this->clear_folder($folder, 'all');
|
||||
$this->clear_folder($folder, 'all');
|
||||
|
||||
// $day = Carbon::now()->subDay()->format('Y-m-d');
|
||||
$day = Carbon::now()->subDay()->format('Y-m-d');
|
||||
|
||||
// $this->grap_tournaments_for_day($day);
|
||||
$this->grap_tournaments_for_day($day);
|
||||
|
||||
// foreach ($this->tournaments_requested as $tournament) {
|
||||
// $this->get_event($day, $tournament);
|
||||
// }
|
||||
foreach ($this->tournaments_requested as $tournament) {
|
||||
$this->get_event($day, $tournament);
|
||||
}
|
||||
|
||||
// $this->import_to_excel($day, "Daily-$day");
|
||||
$this->import_to_excel($folder, $day);
|
||||
|
||||
/**
|
||||
* day 5
|
||||
@@ -135,13 +139,13 @@ trait GrapSofascore
|
||||
|
||||
$day = Carbon::now()->subDays(5)->format('Y-m-d');
|
||||
|
||||
// $this->grap_tournaments_for_day($day);
|
||||
$this->grap_tournaments_for_day($day);
|
||||
|
||||
// foreach ($this->tournaments_requested as $tournament) {
|
||||
// $this->get_event($day, $tournament);
|
||||
// }
|
||||
foreach ($this->tournaments_requested as $tournament) {
|
||||
$this->get_event($day, $tournament);
|
||||
}
|
||||
|
||||
$this->import_to_excel($day, "Daily-$day");
|
||||
$this->import_to_excel($folder, $day);
|
||||
|
||||
$this->send($folder);
|
||||
}
|
||||
@@ -176,16 +180,45 @@ trait GrapSofascore
|
||||
|
||||
/**
|
||||
* Summary of run_range
|
||||
*
|
||||
* @return never
|
||||
*/
|
||||
protected function run_range(string $grapperSelected)
|
||||
protected function range_grapper_nobreak()
|
||||
{
|
||||
$this->load_tournaments_requested($grapperSelected);
|
||||
$folder = 'range';
|
||||
|
||||
$this->load_days($grapperSelected);
|
||||
$this->task_id = 3;
|
||||
|
||||
dd($this->days);
|
||||
$this->set_base_dir($folder);
|
||||
|
||||
$restart = $this->ask_restart();
|
||||
|
||||
if ($restart == 'yes') {
|
||||
$this->restart = 1;
|
||||
$this->clear_folder($folder, 'all');
|
||||
}
|
||||
|
||||
$this->load_tournaments_requested($folder);
|
||||
|
||||
$this->load_days($folder);
|
||||
|
||||
$count = \count($this->days);
|
||||
foreach ($this->days as $key => $day) {
|
||||
if ($this->debug) {
|
||||
$key++;
|
||||
Notice::note("$key/$count", 'br');
|
||||
}
|
||||
|
||||
$this->grap_tournaments_for_day($day);
|
||||
|
||||
foreach ($this->tournaments_requested as $tournament) {
|
||||
$this->get_event($day, $tournament);
|
||||
}
|
||||
}
|
||||
|
||||
Notice::note('Excel', 'g');
|
||||
|
||||
$this->import_to_excel($folder, $day);
|
||||
|
||||
Notice::note('Done', 'g');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,6 +238,7 @@ trait GrapSofascore
|
||||
'excel' => 'Excel',
|
||||
'mail' => 'Send Mail',
|
||||
'clear' => 'Empty Folder',
|
||||
'delete_orphants' => 'Delete Imported Orphants',
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -235,6 +269,18 @@ trait GrapSofascore
|
||||
);
|
||||
}
|
||||
|
||||
protected function ask_restart(): string
|
||||
{
|
||||
return select(
|
||||
label: 'Restart Grapper?',
|
||||
default: 'no',
|
||||
options: [
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function select_what_delete(): string
|
||||
{
|
||||
return select(
|
||||
|
||||
Reference in new issue
Block a user