wip
This commit is contained in:
1 parent
254ca94d73
commit
eb4499efe5
5 files changed
+22
-22
No files matched your search
@@ -135,7 +135,7 @@ trait GrapSofascore
|
|||||||
/**
|
/**
|
||||||
* day 5
|
* day 5
|
||||||
*/
|
*/
|
||||||
// $this->clear_folder($folder, 'data');
|
$this->clear_folder($folder, 'data');
|
||||||
|
|
||||||
$day = Carbon::now()->subDays(5)->format('Y-m-d');
|
$day = Carbon::now()->subDays(5)->format('Y-m-d');
|
||||||
|
|
||||||
@@ -214,9 +214,7 @@ trait GrapSofascore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Notice::note('Excel', 'g');
|
$this->import_to_excel($folder);
|
||||||
|
|
||||||
$this->import_to_excel($folder, $day);
|
|
||||||
|
|
||||||
Notice::note('Done', 'g');
|
Notice::note('Done', 'g');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,13 +216,9 @@ trait GrappingHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a Grap --d --f 67 --fun=4 --task=1
|
* Summary of grap_tournaments_for_day
|
||||||
*
|
*
|
||||||
* Ita Serie-A-Saison 23-08-2025 - 24-05-2026
|
* @return void
|
||||||
* Ger Bundesliga 22-08-2025 – 16-05-2026
|
|
||||||
* Eng Premier league 15-08-2025 - 24-05-2026
|
|
||||||
* Spa La Liga 15-08-2025 - 24-05-2026
|
|
||||||
* Fra Liggue 15-08-2025 - 17-05-2026
|
|
||||||
*/
|
*/
|
||||||
protected function grap_tournaments_for_day(string $day)
|
protected function grap_tournaments_for_day(string $day)
|
||||||
{
|
{
|
||||||
@@ -248,7 +244,7 @@ trait GrappingHelper
|
|||||||
while ($page) {
|
while ($page) {
|
||||||
// $data = $this->curl($url);
|
// $data = $this->curl($url);
|
||||||
|
|
||||||
$this->sleep(1);
|
$this->sleep();
|
||||||
|
|
||||||
$url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
$url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
||||||
|
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ trait GrappingMail
|
|||||||
ini_set('memory_limit', -1);
|
ini_set('memory_limit', -1);
|
||||||
|
|
||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
Notice::note("Eend excel files from folder $folder", 'b');
|
Notice::note("Mail Excel: $folder", 'b');
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = $this->get_tree("$this->data_dir/$folder");
|
$files = $this->get_tree($this->data_dir);
|
||||||
|
|
||||||
$sendfiles = $this->filter($files, ['xlsx']);
|
$sendfiles = $this->filter($files, ['xlsx']);
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Traits\Sofascore;
|
namespace App\Traits\Sofascore;
|
||||||
|
|
||||||
|
use App\Models\SofaScoreTask;
|
||||||
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;
|
||||||
|
|
||||||
@@ -21,14 +21,19 @@ trait GrappingToExcel
|
|||||||
Notice::note("import $folder to excel", 'g');
|
Notice::note("import $folder to excel", 'g');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->titel = ucfirst($folder);
|
switch ($this->task_id) {
|
||||||
if (! $day) {
|
case 1:
|
||||||
$this->titel .= '_'.Carbon::now()->format('Y-m-d');
|
$this->titel .= ucfirst($folder).'_'.$day;
|
||||||
} else {
|
|
||||||
$this->titel .= "_$day";
|
|
||||||
}
|
|
||||||
|
|
||||||
$files = $this->get_tree($this->data_dir);
|
$files = $this->get_tree($this->data_dir.'/'.$day);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$task = SofaScoreTask::with('sport')->where('id', $this->task_id)->first();
|
||||||
|
$this->titel = ucfirst($folder).'-'.$this->clean_string($task->name);
|
||||||
|
$files = $this->get_tree($this->data_dir);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$files = array_chunk($this->filter($files), $this->max);
|
$files = array_chunk($this->filter($files), $this->max);
|
||||||
|
|
||||||
@@ -74,7 +79,7 @@ trait GrappingToExcel
|
|||||||
|
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
|
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->save("$this->data_dir/$folder/$this->titel-$count_from-$count_to.xlsx");
|
$writer->save("$this->data_dir/$this->titel-$count_from-$count_to.xlsx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
2) DOCKER flarsolver to bypass cloudeflare
|
2) DOCKER flarsolver to bypass cloudeflare
|
||||||
|
<!-- https://github.com/Flaresolverr/Flaresolverr -->
|
||||||
<!-- .env -->
|
<!-- .env -->
|
||||||
# Da Laravel lokal (via Brew) läuft, greift es über localhost auf Docker zu
|
# Da Laravel lokal (via Brew) läuft, greift es über localhost auf Docker zu
|
||||||
FLARESOLVERR_URL=http://192.168.178
|
FLARESOLVERR_URL=http://192.168.178
|
||||||
|
|||||||
Reference in new issue
Block a user