new sofaskore task add date to select in statistics
This commit is contained in:
1 parent
f8e6f8183b
commit
5f4a788927
18 files changed
+207
-281
No files matched your search
@@ -16,16 +16,11 @@ ini_set('magic_quotes_runtime', false);
|
||||
|
||||
class Sofascore
|
||||
{
|
||||
|
||||
public static string $grapper_path;
|
||||
|
||||
public static function switch()
|
||||
{
|
||||
self::$grapper_path = app_path('/Console/Commands/Grapper/Sofascore/Grapped/');
|
||||
|
||||
$function = Nuh::$options['fun'];
|
||||
|
||||
switch($function){
|
||||
switch ($function) {
|
||||
case 1:
|
||||
PlayerPerSeason::run();
|
||||
break;
|
||||
@@ -50,7 +45,7 @@ class Sofascore
|
||||
case 8:
|
||||
TaskConfig::end();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Notice::note('id not valid', 'br', 1);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
*/*
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper\Sofascore;
|
||||
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
||||
@@ -81,7 +80,7 @@ class Grapper
|
||||
$event_grapped['name'] = $event->homeTeam['name'] . ' vs ' . $event->awayTeam['name'];
|
||||
$event_grapped['url'] = $url;
|
||||
|
||||
$folder = Sofascore::$grapper_path . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||
$folder = storage_path('sofascore_data') . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||
|
||||
File::makeDirectory($folder, 0775, true, true);
|
||||
|
||||
|
||||
@@ -30,13 +30,25 @@ class LoadDays
|
||||
|
||||
switch ($task->mode) {
|
||||
|
||||
case 'yesterday':
|
||||
case 'auto_updater':
|
||||
$dates[] = [
|
||||
'day' => Carbon::now()->subDay()->format('Y-m-d'),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
$dates[] = [
|
||||
'day' => Carbon::now()->subDays(2)->format('Y-m-d'),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
$dates[] = [
|
||||
'day' => Carbon::now()->subDays(3)->format('Y-m-d'),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
break;
|
||||
|
||||
case 'date':
|
||||
|
||||
@@ -9,7 +9,7 @@ class Sleeper
|
||||
if ($langsam) {
|
||||
$sleep = rand(3000000, 6000000);
|
||||
} else {
|
||||
$sleep = rand(500000, 1000000);
|
||||
$sleep = rand(500000, 100000);
|
||||
}
|
||||
usleep($sleep);
|
||||
}
|
||||
|
||||
@@ -15,34 +15,34 @@ class SendMail
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$days = LoadDays::load();
|
||||
|
||||
|
||||
foreach ($days as $d) {
|
||||
|
||||
$day = $d['day'];
|
||||
|
||||
$zip_file = storage_path('zip_sofascore_data').'/'.$day.'.zip';
|
||||
$zip_file = storage_path('sofascore_data') . '/' . $day . '.zip';
|
||||
|
||||
if(File::exists($zip_file)){
|
||||
if (File::exists($zip_file)) {
|
||||
|
||||
if($debug){
|
||||
Notice::note('Mail send' .$day);
|
||||
if ($debug) {
|
||||
Notice::note('Mail send' . $day);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Mail::send([], [], function ($message) use ($day, $zip_file) {
|
||||
|
||||
$message->to('hermann.telser@gmail.com', 'sofa archive '.$day)
|
||||
->cc('ubaldo.perrucci@gmail.com', 'sofa archive '.$day)
|
||||
$message->to('hermann.telser@gmail.com', 'sofa archive ' . $day)
|
||||
->cc('ubaldo.perrucci@gmail.com', 'sofa archive ' . $day)
|
||||
->subject("sofa archive $day")
|
||||
->attach($zip_file, [
|
||||
'mime' => 'application/x-zip-compressed',
|
||||
'as' => 'sofa archive '.$day.'.zip',
|
||||
'as' => 'sofa archive ' . $day . '.zip',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if($debug){
|
||||
if ($debug) {
|
||||
Notice::note('Mail send', 'g');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user