This commit is contained in:
salam committed 2026-07-18 16:46:33 +02:00
1 parent 11189ec3d6
commit 2be791d63b
14 files changed
+344 -195

No files matched your search

@@ -1,22 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
use App\Utilities\ZipFolder;
class CreateZip
{
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
ZipFolder::create(Sofascore::$storage);
if ($debug) {
Notice::note('zips created', 'bb');
}
}
}
@@ -15,6 +15,15 @@ use Illuminate\Support\Facades\Log;
class DaysTournament
{
/**
* a nuh --d --f 67 --fun=4 --task=1
*
* Ita Serie-A-Saison 23-08-2025 - 24-05-2026
* 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
*/
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
@@ -29,7 +38,7 @@ class DaysTournament
$day = $d['day'];
$slug = $d['slug'];
$has = SofaScoreDayTournament::where('day', $day)->first();
$has = SofaScoreDayTournament::where('day', $day)->where('sport_id', $sport_id)->first();
if ($has) {
if ($debug) {
@@ -154,6 +163,7 @@ class DaysTournament
*/
SofaScoreDayTournament::updateOrCreate([
'tournament_id' => (int) $tournament['id'],
'sport_id' => (int) $sport_id,
'day' => $day,
]);
}
@@ -35,9 +35,6 @@ class Grapper
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
// dd($active_tournaments->toArray());
/**
* empty grapping folder
* empty mailing text
@@ -83,10 +80,13 @@ class Grapper
foreach ($data['events'] as $event) {
$now = Carbon::now()->subHours(4);
$now = Carbon::now()->subHours(3);
$carbon_day = new Carbon($day);
$starttime = Carbon::createFromTimestamp($event['startTimestamp']);
if ($now->greaterThan($starttime)) {
if ($now->greaterThan($starttime) && $starttime->isSameDay($carbon_day)) {
Sleeper::rand(1);
@@ -0,0 +1,15 @@
<?php
namespace App\Console\Commands\Grapper\Sofascore\Helper;
class Strings
{
public static function clean(string $string)
{
$string = str_replace(' ', '-', $string); // Replaces all spaces with hyphens.
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
return preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
}
}