wip grapper
This commit is contained in:
1 parent
417ba0707d
commit
b01d336a05
17 files changed
+9883
-177
No files matched your search
@@ -8,4 +8,20 @@
|
|||||||
3) RIEPILOGO DATI: sostituire HOME con IN FAVOUR e AWAY con AGAINST
|
3) RIEPILOGO DATI: sostituire HOME con IN FAVOUR e AWAY con AGAINST
|
||||||
|
|
||||||
4) FALSCHE BERECHNUNG DER AUSWÄRTSKARTEN für alle Teams. Es wird immer 0 angezeigt, obwohl die Daten in der Datenbank vorhanden sind.
|
4) FALSCHE BERECHNUNG DER AUSWÄRTSKARTEN für alle Teams. Es wird immer 0 angezeigt, obwohl die Daten in der Datenbank vorhanden sind.
|
||||||
4) CALCOLO SBAGLIATO di CARDS AWAY di qualsiasi squadra. Viene visualizzato sempre 0 ma i dati sono presenti nel DB
|
4) CALCOLO SBAGLIATO di CARDS AWAY di qualsiasi squadra. Viene visualizzato sempre 0 ma i dati sono presenti nel DB
|
||||||
|
|
||||||
|
|
||||||
|
1) GRAFICI: visualizzare di default solo un grafico, relativo a IN FAVOUR per Events o HOMETEAM per Performaces
|
||||||
|
2) CALCOLO DELLA MEDIANA: cambiamolo in questo modo: ordiniamo tutti i valori dal minore al maggiore, se il totale dati è dispari prendiamo il valore a metà dell'elenco, se è pari facciamo la media dei due valori a metà dell'elenco
|
||||||
|
3) RIEPILOGO DATI: sostituire HOME con IN FAVOUR e AWAY con AGAINST
|
||||||
|
4) CALCOLO SBAGLIATO di CARDS AWAY di qualsiasi squadra. Viene visualizzato sempre 0 ma i dati sono presenti nel DB
|
||||||
|
5) Aggiungere, nel caso l'operatore scelga di visualizzare i dati statistici GOALS a livello di EVENTS, anche il grafico relativo alle Aspettative Goals Fatte e Subite che possiamo denominare EG-In Favour e EG-Against
|
||||||
|
6) Aggiungere nel Grafico Performance anche i dati della partita (Data / Home / Away / Risultato) come per gli altri grafici
|
||||||
|
7) Il Grafico della Moving Average per Events Performance secondo me è sbagliato quindi probabilmnete c'è un errore nel calcolo della Moving Average
|
||||||
|
8) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono invertiti WIN con LOST
|
||||||
|
9) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES è opportuno sostituire Win con 1, Draw con X e Lost con 2
|
||||||
|
10) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES sono sbagliate le Average Goals
|
||||||
|
11) Nel Riepilogo in verde, quando si seleziona SIMILAR PAST MATCHES i valori delle quote dovrebbero avere due decimali fissi
|
||||||
|
12) Filtrando per PLAYER sono sbagliate le Average Goals, sia Totali che Home/Away
|
||||||
|
13) Quando si filtra per PLAYER meglio sostituire Home con In Favour e Away con Against
|
||||||
|
14) Un piccolo dettaglio: nella combo SIMILAR PAST MATCHES la terza voce è All: Database, ma i ":" dovrebbero essere prima di "All"
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Console\Commands\Grapper;
|
namespace App\Console\Commands\Grapper;
|
||||||
|
|
||||||
use App\Console\Commands\Grapper\Sofascore\Events;
|
use App\Console\Commands\Grapper\Sofascore\Events;
|
||||||
|
use App\Console\Commands\Grapper\Sofascore\Special;
|
||||||
use App\Console\Commands\Grapper\Sofascore\Tournament;
|
use App\Console\Commands\Grapper\Sofascore\Tournament;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\SofaScoreCategorie;
|
use App\Models\SofaScoreCategorie;
|
||||||
@@ -10,13 +11,14 @@ use App\Models\SofaScoreDay;
|
|||||||
use App\Models\SofaScoreDayTournament;
|
use App\Models\SofaScoreDayTournament;
|
||||||
use App\Models\SofaScoreTournament;
|
use App\Models\SofaScoreTournament;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
|
use DateTime;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class Sofascore
|
class Sofascore
|
||||||
{
|
{
|
||||||
public static $auth_header = [];
|
public static $auth_header = [];
|
||||||
|
|
||||||
public static $base_url = '';
|
public static $base_url = '';
|
||||||
|
public static $_days = [];
|
||||||
public static $sport = [1];
|
public static $sport = [1];
|
||||||
|
|
||||||
public static function switch()
|
public static function switch()
|
||||||
@@ -31,6 +33,23 @@ class Sofascore
|
|||||||
Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1);
|
Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Nuh::$options['t']) {
|
||||||
|
self::$_days[] = Carbon::now()->format('Y-m-d');
|
||||||
|
} else if (Nuh::$options['day']) {
|
||||||
|
if (self::validateDate(Nuh::$options['day'])) {
|
||||||
|
self::$_days[] = Nuh::$options['day'];
|
||||||
|
} else {
|
||||||
|
Notice::note('date not valid ' . Nuh::$options['day'], 'r', 1);
|
||||||
|
}
|
||||||
|
} else if (Nuh::$options['days']) {
|
||||||
|
$to = Carbon::now()->subDays(Nuh::$options['days']);
|
||||||
|
$from = Carbon::now()->subDay();
|
||||||
|
while ($from >= $to) {
|
||||||
|
self::$_days[] = $from->format('Y-m-d');
|
||||||
|
$from->subDay();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note(Nuh::$options['sport'] . ' ' . Nuh::$options['name'], 'b');
|
Notice::note(Nuh::$options['sport'] . ' ' . Nuh::$options['name'], 'b');
|
||||||
}
|
}
|
||||||
@@ -42,10 +61,19 @@ class Sofascore
|
|||||||
case 'EVENTS':
|
case 'EVENTS':
|
||||||
Events::load();
|
Events::load();
|
||||||
break;
|
break;
|
||||||
|
case 'SPECIAL':
|
||||||
|
Special::load();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// code...
|
// code...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function validateDate($date, $format = 'Y-m-d')
|
||||||
|
{
|
||||||
|
$d = DateTime::createFromFormat($format, $date);
|
||||||
|
return $d && $d->format($format) == $date;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
/grapped
|
||||||
|
/worldcup-teams
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\Sofascore;
|
||||||
|
|
||||||
|
use App\Utilities\Notice;
|
||||||
|
use App\Console\Commands\Nuh;
|
||||||
|
|
||||||
|
|
||||||
|
class CurlSofa
|
||||||
|
{
|
||||||
|
|
||||||
|
public static $testfile = '/Console/Commands/Grapper/Sofascore/test/';
|
||||||
|
public static function load(string $url)
|
||||||
|
{
|
||||||
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
$save = Nuh::$options['s'] ?? 0;
|
||||||
|
$read = Nuh::$options['r'] ?? 0;
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note($url, 'b');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($read) {
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note('data read localy', 'bb');
|
||||||
|
}
|
||||||
|
$filename = app_path() . self::$testfile . strtolower(str_replace(' ', '_', Nuh::$options['name'])) . '.json';
|
||||||
|
|
||||||
|
$data = file_get_contents($filename);
|
||||||
|
|
||||||
|
return json_decode($data, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$headers = [
|
||||||
|
'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:139.0) Gecko/20100101 Firefox/139.0',
|
||||||
|
'Accept: */*',
|
||||||
|
'Accept-Language: de,en-US;q=0.7,en;q=0.3',
|
||||||
|
'Accept-Encoding: gzip, deflate, br, zstd',
|
||||||
|
'Referer: https://www.sofascore.com/',
|
||||||
|
'X-Requested-With: 5c6b10',
|
||||||
|
'DNT: 1',
|
||||||
|
'Sec-GPC: 1',
|
||||||
|
'Connection: keep-alive',
|
||||||
|
'Sec-Fetch-Dest: empty',
|
||||||
|
'Sec-Fetch-Mode: cors',
|
||||||
|
'Sec-Fetch-Site: same-origin',
|
||||||
|
'Priority: u=4',
|
||||||
|
'Pragma: no-cache',
|
||||||
|
'Cache-Control: no-cache',
|
||||||
|
'TE: trailers'
|
||||||
|
];
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
|
||||||
|
$data = curl_exec($ch);
|
||||||
|
|
||||||
|
$data = gzdecode($data);
|
||||||
|
|
||||||
|
if ($save) {
|
||||||
|
$filename = app_path() . self::$testfile . strtolower(str_replace(' ', '_', Nuh::$options['name'])) . '.json';
|
||||||
|
|
||||||
|
file_put_contents($filename, $data);
|
||||||
|
|
||||||
|
Notice::note('data saved localy', 'bp');
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = json_decode($data, true);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,108 +2,123 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
namespace App\Console\Commands\Grapper\Sofascore;
|
||||||
|
|
||||||
use App\Console\Commands\Curl;
|
use App\Console\Commands\Grapper\Sofascore;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Country;
|
use App\Models\SofaScoreDayTournament;
|
||||||
use App\Models\SofaScoreCategorie;
|
|
||||||
use App\Models\SofaScoreDay;
|
|
||||||
use App\Models\SofaScoreTournament;
|
|
||||||
use App\Models\Sport;
|
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
class Events
|
class Events
|
||||||
{
|
{
|
||||||
public static $auth_header = [];
|
public static $max_days = 30;
|
||||||
|
public static Carbon $days_back;
|
||||||
|
|
||||||
public static $base_url = '';
|
public static $storage_path = '/Console/Commands/Grapper/Sofascore/grapped/';
|
||||||
|
|
||||||
public static $sport = [1];
|
|
||||||
|
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
|
self::$days_back = Carbon::now()->subDays(self::$max_days);
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
$sport_id = Nuh::$options['sport_id'];
|
$sport_id = Nuh::$options['sport_id'];
|
||||||
|
|
||||||
$sport = Sport::where('id', $sport_id)->first();
|
foreach (Sofascore::$_days as $day) {
|
||||||
|
|
||||||
$dates = Carbon::now();
|
$ss_days = SofaScoreDayTournament::with('tournament')
|
||||||
|
->whereHas('tournament', function ($query) use ($sport_id) {
|
||||||
|
$query->where('sport_id', $sport_id);
|
||||||
|
})
|
||||||
|
->where('day', $day)->get();
|
||||||
|
|
||||||
// to grap event id
|
foreach ($ss_days as $ss_day) {
|
||||||
// https://www.sofascore.com/api/v1/unique-tournament/2480/scheduled-events/2022-05-19
|
|
||||||
// https://www.sofascore.com/api/v1/unique-tournament/2480/scheduled-events/2026-05-31
|
|
||||||
|
|
||||||
// per event
|
$sofa_score_categorie_id = $ss_day->tournament->sofa_score_categorie_id;
|
||||||
// https://www.sofascore.com/api/v1/event/16198485/statistics
|
|
||||||
// https://www.sofascore.com/api/v1/event/16198485/odds/1/all
|
|
||||||
$years_back = 7;
|
|
||||||
|
|
||||||
$dates = Carbon::now()->subYears($years_back);
|
$url = Nuh::$options['base_url'] . "api/v1/category/$sofa_score_categorie_id/scheduled-events/$day";
|
||||||
|
|
||||||
SofaScoreTournament::truncate();
|
$rand = rand(500000, 1000000);
|
||||||
SofaScoreCategorie::truncate();
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
foreach ($sportmap as $sport) {
|
|
||||||
|
|
||||||
while ($dates <= Carbon::now()) {
|
|
||||||
|
|
||||||
$day = $dates->format('Y-m-d');
|
|
||||||
|
|
||||||
SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]);
|
|
||||||
|
|
||||||
$page = 1;
|
|
||||||
|
|
||||||
while ($page) {
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/sport/$sport->ss_slug/scheduled-tournaments/$day/page/$page";
|
|
||||||
|
|
||||||
$data = Curl::load($url);
|
|
||||||
|
|
||||||
if ($data['hasNextPage']) {
|
|
||||||
$page++;
|
|
||||||
} else {
|
|
||||||
$page = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($data['scheduled'] as $row) {
|
|
||||||
|
|
||||||
if (isset($row['tournament']['uniqueTournament'])) {
|
|
||||||
$tournament = $row['tournament']['uniqueTournament'];
|
|
||||||
} else {
|
|
||||||
$tournament = $row['tournament'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$category = $tournament['category'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CATEGORY
|
|
||||||
*/
|
|
||||||
$country_id = Country::where('name', $category['name'])->value('id');
|
|
||||||
$call = SofaScoreCategorie::updateOrCreate([
|
|
||||||
'id' => (int) $category['id'],
|
|
||||||
'country_id' => (int) $country_id,
|
|
||||||
'slug' => $category['slug'],
|
|
||||||
], [
|
|
||||||
'name' => $category['name'],
|
|
||||||
]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TOURNAMENT
|
|
||||||
*/
|
|
||||||
$sofa_score_categorie_id = $call->id;
|
|
||||||
SofaScoreTournament::updateOrCreate([
|
|
||||||
'id' => (int) $tournament['id'],
|
|
||||||
'day' => $day,
|
|
||||||
], [
|
|
||||||
'sport_id' => (int) $sport->id,
|
|
||||||
'sofa_score_categorie_id' => (int) $sofa_score_categorie_id,
|
|
||||||
'name' => $tournament['name'],
|
|
||||||
'slug' => $tournament['slug'],
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
Notice::note('All day grapped', 'g', 1);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
Nuh::$options['s'] = 0;
|
||||||
|
|
||||||
|
Nuh::$options['r'] = 0;
|
||||||
|
|
||||||
|
foreach ($data['events'] as $event) {
|
||||||
|
|
||||||
|
if ($event['season']['name'] != "World Cup 2026") {
|
||||||
|
Notice::note("All World Cup 2026 for " . $ss_day->day . ' grapped', 'bb', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$folder = app_path() . self::$storage_path . $ss_day->day . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||||
|
|
||||||
|
File::makeDirectory($folder, 0775, true, true);
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT event
|
||||||
|
*********************************/
|
||||||
|
|
||||||
|
File::put($folder . '/event.json', json_encode($event));
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT statistics
|
||||||
|
*********************************/
|
||||||
|
$event_id = $event['id'];
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/statistics.json', json_encode($data));
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT lineups
|
||||||
|
*********************************/
|
||||||
|
$event_id = $event['id'];
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/lineups.json', json_encode($data));
|
||||||
|
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT lineups
|
||||||
|
*********************************/
|
||||||
|
$event_id = $event['id'];
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/odds.json', json_encode($data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\Sofascore;
|
||||||
|
|
||||||
|
use App\Console\Commands\Grapper\Sofascore;
|
||||||
|
use App\Console\Commands\Nuh;
|
||||||
|
use App\Models\SofaScoreDayTournament;
|
||||||
|
use App\Utilities\Notice;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
|
ini_set('magic_quotes_runtime', false);
|
||||||
|
|
||||||
|
class SPECIAL
|
||||||
|
{
|
||||||
|
|
||||||
|
public static $max_days = 30;
|
||||||
|
public static Carbon $days_back;
|
||||||
|
|
||||||
|
public static $storage_path = '/Console/Commands/Grapper/Sofascore/worldcup-teams/';
|
||||||
|
|
||||||
|
public static function load()
|
||||||
|
{
|
||||||
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "/api/v1/world-cup/meet-the-team";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
$teams = [];
|
||||||
|
|
||||||
|
foreach ($data['groups'] as $groups) {
|
||||||
|
foreach ($groups['teams'] as $team) {
|
||||||
|
$teams[] = [
|
||||||
|
'id' => $team['team']['id'],
|
||||||
|
'slug' => $team['team']['slug'],
|
||||||
|
'name' => $team['team']['name']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($teams as $team) {
|
||||||
|
|
||||||
|
Nuh::$options['s'] = 0;
|
||||||
|
|
||||||
|
Nuh::$options['r'] = 0;
|
||||||
|
|
||||||
|
$url = 'https://www.sofascore.com/api/v1/team/' . $team['id'] . '/events/last/0';
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
foreach ($data['events'] as $event) {
|
||||||
|
// "id" => 12749524
|
||||||
|
// "slug" => "mexico-usa"
|
||||||
|
// "startTimestamp" => 1729045800
|
||||||
|
|
||||||
|
$event_id = $event['id'];
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* Folder
|
||||||
|
*********************************/
|
||||||
|
|
||||||
|
$starttime = Carbon::createFromTimestamp($event['startTimestamp'])->format('Y-m-d');
|
||||||
|
|
||||||
|
$folder = app_path() . self::$storage_path . $starttime . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||||
|
|
||||||
|
File::makeDirectory($folder, 0775, true, true);
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT event basic
|
||||||
|
*********************************/
|
||||||
|
|
||||||
|
File::put($folder . '/event.json', json_encode($event));
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT statistics
|
||||||
|
*********************************/
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/statistics.json', json_encode($data));
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT lineups
|
||||||
|
*********************************/
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/lineups.json', json_encode($data));
|
||||||
|
|
||||||
|
/*********************************
|
||||||
|
* EVENT lineups
|
||||||
|
*********************************/
|
||||||
|
$event_id = $event['id'];
|
||||||
|
|
||||||
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||||
|
|
||||||
|
$rand = rand(500000, 1000000);
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note("Sleep $rand msec", 'y');
|
||||||
|
}
|
||||||
|
usleep($rand);
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
File::put($folder . '/odds.json', json_encode($data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Console\Commands\Grapper\Sofascore;
|
namespace App\Console\Commands\Grapper\Sofascore;
|
||||||
|
|
||||||
use App\Console\Commands\Curl;
|
use App\Console\Commands\Curl;
|
||||||
|
use App\Console\Commands\Grapper\Sofascore;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
use App\Models\SofaScoreCategorie;
|
use App\Models\SofaScoreCategorie;
|
||||||
@@ -16,8 +17,12 @@ use Illuminate\Support\Facades\Log;
|
|||||||
|
|
||||||
class Tournament
|
class Tournament
|
||||||
{
|
{
|
||||||
|
public static $max_days = 30;
|
||||||
|
public static Carbon $days_back;
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
|
self::$days_back = Carbon::now()->subDays(self::$max_days);
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
$force = Nuh::$options['f'] ?? 0;
|
$force = Nuh::$options['f'] ?? 0;
|
||||||
@@ -26,16 +31,10 @@ class Tournament
|
|||||||
|
|
||||||
$sport = Sport::where('id', $sport_id)->first();
|
$sport = Sport::where('id', $sport_id)->first();
|
||||||
|
|
||||||
$_days = self::days($sport);
|
foreach (Sofascore::$_days as $day) {
|
||||||
|
|
||||||
dd($_days);
|
|
||||||
|
|
||||||
while ($grapping_date >= $days_back) {
|
|
||||||
|
|
||||||
$tournaments_counter = 0;
|
$tournaments_counter = 0;
|
||||||
|
|
||||||
$day = $grapping_date->format('Y-m-d');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* grap only one time/sport check
|
* grap only one time/sport check
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +55,7 @@ class Tournament
|
|||||||
}
|
}
|
||||||
usleep($rand);
|
usleep($rand);
|
||||||
|
|
||||||
$data = Curl::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
if ($data['hasNextPage']) {
|
if ($data['hasNextPage']) {
|
||||||
$page++;
|
$page++;
|
||||||
@@ -64,6 +63,8 @@ class Tournament
|
|||||||
$page = false;
|
$page = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$page = false;
|
||||||
|
|
||||||
foreach ($data['scheduled'] as $row) {
|
foreach ($data['scheduled'] as $row) {
|
||||||
|
|
||||||
if (isset($row['tournament']['uniqueTournament'])) {
|
if (isset($row['tournament']['uniqueTournament'])) {
|
||||||
@@ -119,6 +120,8 @@ class Tournament
|
|||||||
$country_id = Country::where('name', trim(str_replace($find, $replace, $category['name'])))->value('id');
|
$country_id = Country::where('name', trim(str_replace($find, $replace, $category['name'])))->value('id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dd($category, $country_id);
|
||||||
|
|
||||||
if (! $country_id) {
|
if (! $country_id) {
|
||||||
// platzhalter fix later sofa_score_categories => txodds countries
|
// platzhalter fix later sofa_score_categories => txodds countries
|
||||||
// CATEGORY find <-> replace
|
// CATEGORY find <-> replace
|
||||||
@@ -153,6 +156,7 @@ class Tournament
|
|||||||
/**
|
/**
|
||||||
* DAY TOURNAMENT
|
* DAY TOURNAMENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SofaScoreDayTournament::updateOrCreate([
|
SofaScoreDayTournament::updateOrCreate([
|
||||||
'tournament_id' => (int) $tournament['id'],
|
'tournament_id' => (int) $tournament['id'],
|
||||||
'day' => $day,
|
'day' => $day,
|
||||||
@@ -163,34 +167,11 @@ class Tournament
|
|||||||
|
|
||||||
SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]);
|
SofaScoreDay::updateOrCreate(['day' => $day], [$sport->ss_slug => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Nuh::$options['test']) {
|
|
||||||
Notice::note('Test exit after one day', 'b', 1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note('Having Sport: ' . Nuh::$options['sport'] . ' Day: ' . $day, 'b');
|
Notice::note(Nuh::$options['sport'] . ' ' . $day, 'b');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$grapping_date->subDay();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function days(Sport $sport)
|
|
||||||
{
|
|
||||||
$d = Carbon::now()->subDay();
|
|
||||||
Notice::note($d->format('d. m. Y'), 'b');
|
|
||||||
|
|
||||||
$loop = true;
|
|
||||||
while ($loop) {
|
|
||||||
if (!SofaScoreDay::where('day', $d)->first()) {
|
|
||||||
// SofaScoreDay::insert(['day' => $d]);
|
|
||||||
$d->subDay();
|
|
||||||
} else {
|
|
||||||
$loop = false;
|
|
||||||
}
|
|
||||||
Notice::note($d->format('d. m. Y'), 'g');
|
|
||||||
}
|
|
||||||
return SofaScoreDay::where($sport->ss_slug, 0)->get();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"events":[{"eventState":{},"tournament":{"name":"FIFA World Cup, Group B","slug":"world-championship-gr-b","category":{"name":"World","slug":"world","sport":{"name":"Football","slug":"football","id":1},"priority":20,"country":{},"id":1468,"flag":"international","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0639\u0627\u0644\u0645","hi":"\u0935\u093f\u0936\u094d\u0935","bn":"\u09ac\u09bf\u09b6\u09cd\u09ac","ru":"\u041c\u0438\u0440"},"shortNameTranslation":{}}},"uniqueTournament":{"name":"FIFA World Cup","slug":"world-championship","primaryColorHex":"#d20a11","secondaryColorHex":"#e8bb57","category":{"name":"World","slug":"world","sport":{"name":"Football","slug":"football","id":1},"priority":20,"country":{},"id":1468,"flag":"international","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0639\u0627\u0644\u0645","hi":"\u0935\u093f\u0936\u094d\u0935","bn":"\u09ac\u09bf\u09b6\u09cd\u09ac","ru":"\u041c\u0438\u0440"},"shortNameTranslation":{}}},"userCount":1344736,"hasPerformanceGraphFeature":false,"country":{},"id":16,"hasEventPlayerStatistics":true,"displayInverseHomeAwayTeams":false,"fieldTranslations":{"nameTranslation":{"pt-pt":"Mundial","ar":"\u0643\u0623\u0633 \u0627\u0644\u0639\u0627\u0644\u0645","bn":"\u0993\u09af\u09bc\u09be\u09b0\u09cd\u09b2\u09cd\u09a1 \u099a\u09cd\u09af\u09be\u09ae\u09cd\u09aa\u09bf\u09af\u09bc\u09a8\u09b6\u09bf\u09aa","hi":"\u0935\u0930\u094d\u0932\u094d\u0921 \u091a\u0948\u0902\u092a\u093f\u092f\u0928\u0936\u093f\u092a","hr":"FIFA Svjetsko prvenstvo","az":"F\u0130FA D\u00fcnya Kuboku","nl":"Wereldkampioenschap","fr":"Coupe du monde","de":"Weltmeisterschaft","el":"\u03a0\u03b1\u03b3\u03ba\u03cc\u03c3\u03bc\u03b9\u03bf \u039a\u03cd\u03c0\u03b5\u03bb\u03bb\u03bf","hu":"FIFA Vil\u00e1gbajnoks\u00e1g","id":"Piala Dunia FIFA","it":"Coppa del Mondo FIFA","ja":"FIFA\u30ef\u30fc\u30eb\u30c9\u30ab\u30c3\u30d7","ko":"FIFA \uc6d4\ub4dc\ucef5","no":"Verdensmesterskapet","pl":"Mistrzostwa \u015awiata","pt":"Copa do Mundo FIFA","ro":"Campionatul Mondial","es":"Copa Mundial","es-la":"Copa Mundial","sv":"V\u00e4rldsm\u00e4sterskapet","th":"\u0e1f\u0e38\u0e15\u0e1a\u0e2d\u0e25\u0e42\u0e25\u0e01","tr":"FIFA D\u00fcnya Kupas\u0131","vi":"Gi\u1ea3i V\u00f4 \u0110\u1ecbch Th\u1ebf Gi\u1edbi","ru":"\u0427\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442 \u043c\u0438\u0440\u0430","sr":"\u0421\u0432\u0435\u0442\u0441\u043a\u043e \u043f\u0440\u0432\u0435\u043d\u0441\u0442\u0432\u043e"},"shortNameTranslation":{}}},"priority":812,"isGroup":true,"groupName":"Group B","groupSign":"B","isLive":false,"id":3955,"fieldTranslations":{"nameTranslation":{"ar":"\u0628\u0637\u0648\u0644\u0629 \u0627\u0644\u0639\u0627\u0644\u0645\u060c \u0627\u0644\u0645\u062c\u0645\u0648\u0639\u0629 B","bn":"\u0993\u09af\u09bc\u09be\u09b0\u09cd\u09b2\u09cd\u09a1 \u099a\u09cd\u09af\u09be\u09ae\u09cd\u09aa\u09bf\u09af\u09bc\u09a8\u09b6\u09bf\u09aa, \u0997\u09cd\u09b0. \u09ac\u09bf","hr":"FIFA Svjetsko prvenstvo, Grupa B","az":"F\u0130FA D\u00fcnya Kuboku, Qrup B","nl":"Wereldkampioenschap, Groep B","fr":"Coupe du monde, Groupe B","de":"Weltmeisterschaft, Gruppe B","el":"\u03a0\u03b1\u03b3\u03ba\u03cc\u03c3\u03bc\u03b9\u03bf \u039a\u03cd\u03c0\u03b5\u03bb\u03bb\u03bf, \u038c\u03bc\u03b9\u03bb\u03bf\u03c2 B","hu":"Vil\u00e1gbajnoks\u00e1g, Csoport B","id":"Piala Dunia FIFA, Grup B","it":"Coppa del Mondo, Gruppo B","ja":"FIFA\u30ef\u30fc\u30eb\u30c9\u30ab\u30c3\u30d7, \u30b0\u30eb\u30fc\u30d7B","ko":"FIFA \uc6d4\ub4dc\ucef5, \uadf8\ub8f9 B","no":"Verdensmesterskapet, Gruppe B","pl":"Mistrzostwa \u015awiata, Grupa B","pt":"Copa do Mundo FIFA, Grupo B","ro":"Campionatul Mondial, Grupa B","es":"Copa Mundial, Grupo B","es-la":"Copa Mundial, Grupo B","pt-pt":"Mundial, Grupo B","ru":"\u0427\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442 \u043c\u0438\u0440\u0430, \u0413\u0440\u0443\u043f\u043f\u0430 B","hi":"\u0935\u0930\u094d\u0932\u094d\u0921 \u091a\u0948\u0902\u092a\u093f\u092f\u0928\u0936\u093f\u092a, \u0917\u094d\u0930\u0947\u0921 \u092c\u0940","sv":"V\u00e4rldsm\u00e4sterskapet, Grupp B","th":"\u0e1f\u0e38\u0e15\u0e1a\u0e2d\u0e25\u0e42\u0e25\u0e01, \u0e01\u0e25\u0e38\u0e48\u0e21 B","tr":"FIFA D\u00fcnya Kupas\u0131, Grup B","vi":"Gi\u1ea3i V\u00f4 \u0110\u1ecbch Th\u1ebf Gi\u1edbi, B\u1ea3ng B","sr":"\u0421\u0432\u0435\u0442\u0441\u043a\u043e \u043f\u0440\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u0413\u0440\u0443\u043f\u0430 \u0411"},"shortNameTranslation":{}}},"season":{"name":"World Cup 2026","year":"2026","editor":false,"seasonCoverageInfo":{},"id":58210},"roundInfo":{"round":1},"customId":"EObscVb","status":{"code":100,"description":"Ended","type":"finished"},"winnerCode":3,"homeTeam":{"name":"Canada","slug":"canada","shortName":"Canada","gender":"M","sport":{"name":"Football","slug":"football","id":1},"userCount":131198,"nameCode":"CAN","ranking":30,"disabled":false,"national":true,"type":0,"country":{"alpha2":"CA","alpha3":"CAN","name":"Canada","slug":"canada"},"id":4752,"subTeams":[],"teamColors":{"primary"Line truncated
|
||||||
File renamed without changes.
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"scheduled":[{"tournament":{"name":"FIFA World Cup, Group B","slug":"world-championship-gr-b","category":{"name":"World","slug":"world","sport":{"name":"Football","slug":"football","id":1},"priority":20,"id":1468,"flag":"international","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0639\u0627\u0644\u0645","bn":"\u09ac\u09bf\u09b6\u09cd\u09ac","hi":"\u0935\u093f\u0936\u094d\u0935","ru":"\u041c\u0438\u0440"},"shortNameTranslation":{}}},"uniqueTournament":{"name":"FIFA World Cup","slug":"world-championship","category":{"name":"World","slug":"world","sport":{"name":"Football","slug":"football","id":1},"priority":20,"id":1468,"flag":"international","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0639\u0627\u0644\u0645","bn":"\u09ac\u09bf\u09b6\u09cd\u09ac","hi":"\u0935\u093f\u0936\u094d\u0935","ru":"\u041c\u0438\u0440"},"shortNameTranslation":{}}},"userCount":1344736,"hasPerformanceGraphFeature":false,"id":16,"hasEventPlayerStatistics":true,"displayInverseHomeAwayTeams":false,"fieldTranslations":{"nameTranslation":{"ar":"\u0643\u0623\u0633 \u0627\u0644\u0639\u0627\u0644\u0645","az":"F\u0130FA D\u00fcnya Kuboku","bn":"\u0993\u09af\u09bc\u09be\u09b0\u09cd\u09b2\u09cd\u09a1 \u099a\u09cd\u09af\u09be\u09ae\u09cd\u09aa\u09bf\u09af\u09bc\u09a8\u09b6\u09bf\u09aa","de":"Weltmeisterschaft","el":"\u03a0\u03b1\u03b3\u03ba\u03cc\u03c3\u03bc\u03b9\u03bf \u039a\u03cd\u03c0\u03b5\u03bb\u03bb\u03bf","es":"Copa Mundial","es-la":"Copa Mundial","fr":"Coupe du monde","hi":"\u0935\u0930\u094d\u0932\u094d\u0921 \u091a\u0948\u0902\u092a\u093f\u092f\u0928\u0936\u093f\u092a","hr":"FIFA Svjetsko prvenstvo","hu":"FIFA Vil\u00e1gbajnoks\u00e1g","id":"Piala Dunia FIFA","it":"Coppa del Mondo FIFA","ja":"FIFA\u30ef\u30fc\u30eb\u30c9\u30ab\u30c3\u30d7","ko":"FIFA \uc6d4\ub4dc\ucef5","nl":"Wereldkampioenschap","no":"Verdensmesterskapet","pl":"Mistrzostwa \u015awiata","pt":"Copa do Mundo FIFA","pt-pt":"Mundial","ro":"Campionatul Mondial","ru":"\u0427\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442 \u043c\u0438\u0440\u0430","sr":"\u0421\u0432\u0435\u0442\u0441\u043a\u043e \u043f\u0440\u0432\u0435\u043d\u0441\u0442\u0432\u043e","sv":"V\u00e4rldsm\u00e4sterskapet","th":"\u0e1f\u0e38\u0e15\u0e1a\u0e2d\u0e25\u0e42\u0e25\u0e01","tr":"FIFA D\u00fcnya Kupas\u0131","vi":"Gi\u1ea3i V\u00f4 \u0110\u1ecbch Th\u1ebf Gi\u1edbi"},"shortNameTranslation":{}}},"priority":812,"groupSign":"B","id":3955,"fieldTranslations":{"nameTranslation":{"ar":"\u0628\u0637\u0648\u0644\u0629 \u0627\u0644\u0639\u0627\u0644\u0645\u060c \u0627\u0644\u0645\u062c\u0645\u0648\u0639\u0629 B","bn":"\u0993\u09af\u09bc\u09be\u09b0\u09cd\u09b2\u09cd\u09a1 \u099a\u09cd\u09af\u09be\u09ae\u09cd\u09aa\u09bf\u09af\u09bc\u09a8\u09b6\u09bf\u09aa, \u0997\u09cd\u09b0. \u09ac\u09bf","hr":"FIFA Svjetsko prvenstvo, Grupa B","az":"F\u0130FA D\u00fcnya Kuboku, Qrup B","nl":"Wereldkampioenschap, Groep B","fr":"Coupe du monde, Groupe B","de":"Weltmeisterschaft, Gruppe B","el":"\u03a0\u03b1\u03b3\u03ba\u03cc\u03c3\u03bc\u03b9\u03bf \u039a\u03cd\u03c0\u03b5\u03bb\u03bb\u03bf, \u038c\u03bc\u03b9\u03bb\u03bf\u03c2 B","hu":"Vil\u00e1gbajnoks\u00e1g, Csoport B","id":"Piala Dunia FIFA, Grup B","it":"Coppa del Mondo, Gruppo B","ja":"FIFA\u30ef\u30fc\u30eb\u30c9\u30ab\u30c3\u30d7, \u30b0\u30eb\u30fc\u30d7B","ko":"FIFA \uc6d4\ub4dc\ucef5, \uadf8\ub8f9 B","no":"Verdensmesterskapet, Gruppe B","pl":"Mistrzostwa \u015awiata, Grupa B","pt":"Copa do Mundo FIFA, Grupo B","ro":"Campionatul Mondial, Grupa B","es":"Copa Mundial, Grupo B","es-la":"Copa Mundial, Grupo B","pt-pt":"Mundial, Grupo B","ru":"\u0427\u0435\u043c\u043f\u0438\u043e\u043d\u0430\u0442 \u043c\u0438\u0440\u0430, \u0413\u0440\u0443\u043f\u043f\u0430 B","hi":"\u0935\u0930\u094d\u0932\u094d\u0921 \u091a\u0948\u0902\u092a\u093f\u092f\u0928\u0936\u093f\u092a, \u0917\u094d\u0930\u0947\u0921 \u092c\u0940","sv":"V\u00e4rldsm\u00e4sterskapet, Grupp B","th":"\u0e1f\u0e38\u0e15\u0e1a\u0e2d\u0e25\u0e42\u0e25\u0e01, \u0e01\u0e25\u0e38\u0e48\u0e21 B","tr":"FIFA D\u00fcnya Kupas\u0131, Grup B","vi":"Gi\u1ea3i V\u00f4 \u0110\u1ecbch Th\u1ebf Gi\u1edbi, B\u1ea3ng B","sr":"\u0421\u0432\u0435\u0442\u0441\u043a\u043e \u043f\u0440\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u0413\u0440\u0443\u043f\u0430 \u0411"},"shortNameTranslation":{}}},"timezoneEventCount":{"-43200":1,"-39600":1,"-36000":1,"-34200":1,"-32400":1,"-28800":1,"-25200":1,"-21600":1,"-18000":1,"-16200":1,"-14400":1,"-12600":1,"-10800":1,"-9000":1,"-7200":1,"-3600":1,"0":1,"3600":1,"7200":1,"10800":1,"12600":1,"14400":1,"16200":1,"18000":1,"19800":1,"20700":1,"21600":1,"23400":1,"25200":1,"28800":1,"30600":1,"31500":1,"32400":1,"34200":1,"36000":1,"37800":1,"39600":1,"43200":1,"45900":1,"46800":1,"49500":1,"50400":1}},{"tournament":{"name":"FIFA World Cup, Group C","slug":"world-championship-gr-c","category":{"name":"World","slug":"world","sport":{"name":"Football","slug":"football","id":1},"priority":20,"id":1468,"flag":"international","fieldTranslations":{"nameTranslation":{"ar":"\u062Line truncated
|
||||||
@@ -23,7 +23,7 @@ class Nuh extends Command
|
|||||||
|
|
||||||
public static $id = 0;
|
public static $id = 0;
|
||||||
|
|
||||||
protected $signature = 'nuh {process=help} {--truncate} {--test} {--id=0} {--fn=} {--gid=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--g} {--t} {--q} {--f} {--b} {--e}';
|
protected $signature = 'nuh {process=help} {--truncate} {--days=0} {--day=0} {--id=0} {--fn=} {--gid=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--g} {--t} {--q} {--f} {--b} {--e}';
|
||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
@@ -34,41 +34,43 @@ class Nuh extends Command
|
|||||||
|
|
||||||
if ($this->argument('process') == 'help') {
|
if ($this->argument('process') == 'help') {
|
||||||
$txt = PHP_EOL;
|
$txt = PHP_EOL;
|
||||||
$txt .= 'Parameters'.PHP_EOL;
|
$txt .= 'Parameters' . PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------' . PHP_EOL;
|
||||||
$txt .= 'process [id] (required)'.PHP_EOL;
|
$txt .= 'process [id] (required)' . PHP_EOL;
|
||||||
$txt .= '--id=matchid (optional) calling spezific id'.PHP_EOL;
|
$txt .= '--id=matchid (optional) calling spezific id' . PHP_EOL;
|
||||||
$txt .= '--fn=name (optional) [bkms, markets]'.PHP_EOL;
|
$txt .= '--fn=name (optional) [bkms, markets]' . PHP_EOL;
|
||||||
$txt .= '--gid=groupid (optional) [bkms, groupid]'.PHP_EOL;
|
$txt .= '--gid=groupid (optional) [bkms, groupid]' . PHP_EOL;
|
||||||
$txt .= '--truncate (optional)'.PHP_EOL;
|
$txt .= '--truncate (optional)' . PHP_EOL;
|
||||||
$txt .= '--test (optional)'.PHP_EOL;
|
$txt .= '--day (optional) sofascore grap day format "Y-m-d" or --t for today' . PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
$txt .= '--days (optional) sofascore grap days back from yesterday' . PHP_EOL;
|
||||||
$txt .= 'Options'.PHP_EOL;
|
$txt .= '----------------------------------------------' . PHP_EOL . PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= 'Options' . PHP_EOL;
|
||||||
$txt .= '--p use proxy'.PHP_EOL;
|
$txt .= '----------------------------------------------' . PHP_EOL;
|
||||||
$txt .= '--d debug'.PHP_EOL;
|
$txt .= '--t load today' . PHP_EOL;
|
||||||
$txt .= '--f run also when odd'.PHP_EOL;
|
$txt .= '--p use proxy' . PHP_EOL;
|
||||||
$txt .= '--x generate supervisors'.PHP_EOL;
|
$txt .= '--d debug' . PHP_EOL;
|
||||||
$txt .= '--t load today'.PHP_EOL;
|
$txt .= '--f run also when odd' . PHP_EOL;
|
||||||
$txt .= '--a all by id'.PHP_EOL;
|
$txt .= '--x generate supervisors' . PHP_EOL;
|
||||||
$txt .= '--b block update (reload all for txodds)'.PHP_EOL;
|
$txt .= '--t load today' . PHP_EOL;
|
||||||
$txt .= '--w laod this week (tx)'.PHP_EOL;
|
$txt .= '--a all by id' . PHP_EOL;
|
||||||
$txt .= '--g by minor groups (tx)'.PHP_EOL;
|
$txt .= '--b block update (reload all for txodds)' . PHP_EOL;
|
||||||
$txt .= '--r read data from file '.PHP_EOL;
|
$txt .= '--w laod this week (tx)' . PHP_EOL;
|
||||||
$txt .= '--s store data to file '.PHP_EOL;
|
$txt .= '--g by minor groups (tx)' . PHP_EOL;
|
||||||
$txt .= '--f force update market'.PHP_EOL;
|
$txt .= '--r read data from file ' . PHP_EOL;
|
||||||
$txt .= '--q print all queries'.PHP_EOL;
|
$txt .= '--s store data to file ' . PHP_EOL;
|
||||||
$txt .= '--e echo client data'.PHP_EOL;
|
$txt .= '--f force update market' . PHP_EOL;
|
||||||
|
$txt .= '--q print all queries' . PHP_EOL;
|
||||||
|
$txt .= '--e echo client data' . PHP_EOL;
|
||||||
|
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
$txt .= '----------------------------------------------' . PHP_EOL . PHP_EOL;
|
||||||
$txt .= 'Supervisors'.PHP_EOL;
|
$txt .= 'Supervisors' . PHP_EOL;
|
||||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
$txt .= '----------------------------------------------' . PHP_EOL;
|
||||||
$tmp = Supervisor::orderBy('provider_id')->get();
|
$tmp = Supervisor::orderBy('provider_id')->get();
|
||||||
foreach ($tmp as $value) {
|
foreach ($tmp as $value) {
|
||||||
if ($value->sport_id) {
|
if ($value->sport_id) {
|
||||||
$txt .= sprintf('% 3d', $value->id).' '.$value->provider->name.' - '.$value->sport->name.' '.$value->name.PHP_EOL;
|
$txt .= sprintf('% 3d', $value->id) . ' ' . $value->provider->name . ' - ' . $value->sport->name . ' ' . $value->name . PHP_EOL;
|
||||||
} else {
|
} else {
|
||||||
$txt .= sprintf('% 3d', $value->id).' '.$value->provider->name.' - All '.$value->name.PHP_EOL;
|
$txt .= sprintf('% 3d', $value->id) . ' ' . $value->provider->name . ' - All ' . $value->name . PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Notice::note($txt, 'b', 1);
|
Notice::note($txt, 'b', 1);
|
||||||
@@ -138,6 +140,5 @@ class Nuh extends Command
|
|||||||
if ($queries) {
|
if ($queries) {
|
||||||
Notice::db(DB::getQueryLog());
|
Notice::db(DB::getQueryLog());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,9 @@ use Filament\Actions\DeleteAction;
|
|||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Support\Enums\FontWeight;
|
||||||
|
use Filament\Support\Enums\Size;
|
||||||
|
use Filament\Support\Enums\TextSize;
|
||||||
use Filament\Tables\Columns\Layout\Split;
|
use Filament\Tables\Columns\Layout\Split;
|
||||||
use Filament\Tables\Columns\Layout\Stack;
|
use Filament\Tables\Columns\Layout\Stack;
|
||||||
use Filament\Tables\Columns\SelectColumn;
|
use Filament\Tables\Columns\SelectColumn;
|
||||||
@@ -34,9 +37,12 @@ class SupervisorsTable
|
|||||||
->poll('15s')
|
->poll('15s')
|
||||||
->columns([
|
->columns([
|
||||||
Split::make([
|
Split::make([
|
||||||
TextColumn::make('id')->badge()->alignCenter(),
|
TextColumn::make('id')->badge()->alignCenter()
|
||||||
|
->color('black ')
|
||||||
|
->weight(FontWeight::Black)
|
||||||
|
->size(TextSize::Large),
|
||||||
TextColumn::make('provider.name')
|
TextColumn::make('provider.name')
|
||||||
->color(fn ($record): string => match ($record->provider_id) {
|
->color(fn($record): string => match ($record->provider_id) {
|
||||||
1 => 'danger',
|
1 => 'danger',
|
||||||
8 => 'danger',
|
8 => 'danger',
|
||||||
2 => 'success',
|
2 => 'success',
|
||||||
@@ -102,6 +108,7 @@ class SupervisorsTable
|
|||||||
return [
|
return [
|
||||||
'TOURNAMENTS' => 'TOURNAMENTS',
|
'TOURNAMENTS' => 'TOURNAMENTS',
|
||||||
'EVENTS' => 'EVENTS',
|
'EVENTS' => 'EVENTS',
|
||||||
|
'SPECIAL' => 'SPECIAL',
|
||||||
];
|
];
|
||||||
default:
|
default:
|
||||||
return [];
|
return [];
|
||||||
@@ -109,9 +116,9 @@ class SupervisorsTable
|
|||||||
}),
|
}),
|
||||||
SelectColumn::make('sport_id')
|
SelectColumn::make('sport_id')
|
||||||
->hidden(function (ListSupervisors $livewire) {
|
->hidden(function (ListSupervisors $livewire) {
|
||||||
return $livewire->tableFilters['provider_id']['value'] == 11;
|
return in_array($livewire->tableFilters['provider_id']['value'], [11]);
|
||||||
})
|
})
|
||||||
->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id'))
|
->options(fn() => Sport::where('is_active', 1)->pluck('name', 'id'))
|
||||||
->placeholder('All'),
|
->placeholder('All'),
|
||||||
SelectColumn::make('txodds_market_id')
|
SelectColumn::make('txodds_market_id')
|
||||||
->visible(function (ListSupervisors $livewire) {
|
->visible(function (ListSupervisors $livewire) {
|
||||||
@@ -135,27 +142,30 @@ class SupervisorsTable
|
|||||||
Stack::make([
|
Stack::make([
|
||||||
TextInputColumn::make('days_from')->prefix('Days Fr')
|
TextInputColumn::make('days_from')->prefix('Days Fr')
|
||||||
->hidden(function (ListSupervisors $livewire) {
|
->hidden(function (ListSupervisors $livewire) {
|
||||||
return in_array($livewire->tableFilters['provider_id']['value'], [7, 8, 11]);
|
return in_array($livewire->tableFilters['provider_id']['value'], [7, 8, 11, 12]);
|
||||||
}),
|
}),
|
||||||
TextInputColumn::make('days_to')->prefix('Days To')
|
TextInputColumn::make('days_to')->prefix('Days To')
|
||||||
->hidden(function (ListSupervisors $livewire) {
|
->hidden(function (ListSupervisors $livewire) {
|
||||||
return in_array($livewire->tableFilters['provider_id']['value'], [7, 8, 11]);
|
return in_array($livewire->tableFilters['provider_id']['value'], [7, 8, 11, 12]);
|
||||||
}),
|
}),
|
||||||
])->space(3),
|
])->space(3),
|
||||||
Stack::make([
|
Stack::make([
|
||||||
TextColumn::make('lastcall')
|
TextColumn::make('lastcall')
|
||||||
->prefix('Lastcall: ')
|
->prefix('Lastcall: ')
|
||||||
->badge()
|
->badge()
|
||||||
->color(fn ($state): string => ($state > 0 && $state > time() - 300) ? 'success' : 'danger')
|
->color(fn($state): string => ($state > 0 && $state > time() - 300) ? 'success' : 'danger')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->visible(function (ListSupervisors $livewire) {
|
->visible(function (ListSupervisors $livewire) {
|
||||||
return $livewire->tableFilters['provider_id']['value'] == 8;
|
return $livewire->tableFilters['provider_id']['value'] == 8;
|
||||||
}),
|
}),
|
||||||
TextInputColumn::make('sleep')->prefix('Seep'),
|
TextInputColumn::make('sleep')->prefix('Seep')
|
||||||
|
->hidden(function (ListSupervisors $livewire) {
|
||||||
|
return in_array($livewire->tableFilters['provider_id']['value'], [8, 12]);
|
||||||
|
}),
|
||||||
TextInputColumn::make('commandline_options')->prefix('Bash')
|
TextInputColumn::make('commandline_options')->prefix('Bash')
|
||||||
->tooltip('command used in supervisor script')
|
->tooltip('command used in supervisor script')
|
||||||
->hidden(function (ListSupervisors $livewire) {
|
->hidden(function (ListSupervisors $livewire) {
|
||||||
return $livewire->tableFilters['provider_id']['value'] == 8;
|
return in_array($livewire->tableFilters['provider_id']['value'], [8, 12]);
|
||||||
}),
|
}),
|
||||||
])->space(3),
|
])->space(3),
|
||||||
SelectColumn::make('is_supervisor')
|
SelectColumn::make('is_supervisor')
|
||||||
|
|||||||
Generated
+20
-20
@@ -2527,16 +2527,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/uri-template",
|
"name": "guzzlehttp/uri-template",
|
||||||
"version": "v1.0.6",
|
"version": "v1.0.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/uri-template.git",
|
"url": "https://github.com/guzzle/uri-template.git",
|
||||||
"reference": "eef7f87bab6f204eba3c39224d8075c70c637946"
|
"reference": "7fe811c23a9e3cd712b4389eaeb50b5456d8c529"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/uri-template/zipball/eef7f87bab6f204eba3c39224d8075c70c637946",
|
"url": "https://api.github.com/repos/guzzle/uri-template/zipball/7fe811c23a9e3cd712b4389eaeb50b5456d8c529",
|
||||||
"reference": "eef7f87bab6f204eba3c39224d8075c70c637946",
|
"reference": "7fe811c23a9e3cd712b4389eaeb50b5456d8c529",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2593,7 +2593,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/uri-template/issues",
|
"issues": "https://github.com/guzzle/uri-template/issues",
|
||||||
"source": "https://github.com/guzzle/uri-template/tree/v1.0.6"
|
"source": "https://github.com/guzzle/uri-template/tree/v1.0.7"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2609,7 +2609,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-05-23T22:00:21+00:00"
|
"time": "2026-06-12T21:33:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jaocero/radio-deck",
|
"name": "jaocero/radio-deck",
|
||||||
@@ -2688,23 +2688,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jaybizzle/crawler-detect",
|
"name": "jaybizzle/crawler-detect",
|
||||||
"version": "v1.3.11",
|
"version": "v1.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
"url": "https://github.com/JayBizzle/Crawler-Detect.git",
|
||||||
"reference": "484792759de89fe94ea6a192065ea7cd99f1eaa2"
|
"reference": "20d7bd4a6ee68444693fe75bc5c6f12f65ad512d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/484792759de89fe94ea6a192065ea7cd99f1eaa2",
|
"url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/20d7bd4a6ee68444693fe75bc5c6f12f65ad512d",
|
||||||
"reference": "484792759de89fe94ea6a192065ea7cd99f1eaa2",
|
"reference": "20d7bd4a6ee68444693fe75bc5c6f12f65ad512d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1.0"
|
"php": ">=7.2.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^4.8|^5.5|^6.5|^7.5|^8.5.52|^9.4"
|
"phpunit/phpunit": "^8.5.52|^9.4"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -2734,9 +2734,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/JayBizzle/Crawler-Detect/issues",
|
"issues": "https://github.com/JayBizzle/Crawler-Detect/issues",
|
||||||
"source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.3.11"
|
"source": "https://github.com/JayBizzle/Crawler-Detect/tree/v1.4.0"
|
||||||
},
|
},
|
||||||
"time": "2026-05-10T14:08:06+00:00"
|
"time": "2026-06-11T18:29:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jenssegers/agent",
|
"name": "jenssegers/agent",
|
||||||
@@ -9580,16 +9580,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ueberdosis/tiptap-php",
|
"name": "ueberdosis/tiptap-php",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/ueberdosis/tiptap-php.git",
|
"url": "https://github.com/ueberdosis/tiptap-php.git",
|
||||||
"reference": "6ea321fa665080e1a72ac5f52dfab19f6a292e2d"
|
"reference": "74bfb7be1c8c6102b240f3879b7f984a6ab87b97"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/ueberdosis/tiptap-php/zipball/6ea321fa665080e1a72ac5f52dfab19f6a292e2d",
|
"url": "https://api.github.com/repos/ueberdosis/tiptap-php/zipball/74bfb7be1c8c6102b240f3879b7f984a6ab87b97",
|
||||||
"reference": "6ea321fa665080e1a72ac5f52dfab19f6a292e2d",
|
"reference": "74bfb7be1c8c6102b240f3879b7f984a6ab87b97",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -9629,7 +9629,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/ueberdosis/tiptap-php/issues",
|
"issues": "https://github.com/ueberdosis/tiptap-php/issues",
|
||||||
"source": "https://github.com/ueberdosis/tiptap-php/tree/2.1.0"
|
"source": "https://github.com/ueberdosis/tiptap-php/tree/2.1.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -9645,7 +9645,7 @@
|
|||||||
"type": "open_collective"
|
"type": "open_collective"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-01-10T16:40:02+00:00"
|
"time": "2026-06-12T18:19:46+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vlucas/phpdotenv",
|
"name": "vlucas/phpdotenv",
|
||||||
|
|||||||
Executable
+11
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
from curl_cffi import requests
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.get('https://httpbin.org/get')
|
||||||
|
if response.status_code == 200:
|
||||||
|
print('Yay! curl_cffi installation is successful!')
|
||||||
|
else:
|
||||||
|
print('Something went wrong with the request. Try again!')
|
||||||
|
except Exception as e:
|
||||||
|
print(f'Oops! An error occurred: {e}')
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
curl-impersonate -v -L https://httpbin.org/get
|
||||||
Reference in new issue
Block a user