wip grapper
This commit is contained in:
1 parent
dc76eb35ae
commit
db5ce95b30
14 files changed
+81
-109
No files matched your search
@@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper;
|
||||
use App\Console\Commands\Grapper\Sofascore\CreateZip;
|
||||
use App\Console\Commands\Grapper\Sofascore\DaysTournament;
|
||||
use App\Console\Commands\Grapper\Sofascore\Grapper;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\TaskConfig;
|
||||
use App\Console\Commands\Grapper\Sofascore\PlayerPerSeason;
|
||||
use App\Console\Commands\Grapper\Sofascore\SendMail;
|
||||
@@ -18,15 +17,11 @@ ini_set('magic_quotes_runtime', false);
|
||||
class Sofascore
|
||||
{
|
||||
|
||||
public static string $source_path;
|
||||
|
||||
public static string $storage_path;
|
||||
public static string $grapper_path;
|
||||
|
||||
public static function switch()
|
||||
{
|
||||
self::$source_path = app_path('/Console/Commands/Grapper/Sofascore/Grapped');
|
||||
|
||||
self::$storage_path = storage_path('zip_sofascore_data');
|
||||
self::$grapper_path = app_path('/Console/Commands/Grapper/Sofascore/Grapped/');
|
||||
|
||||
$function = Nuh::$options['fun'];
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ class CreateZip
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$task = Nuh::$options['task'] ?? 0;
|
||||
|
||||
$days = LoadDays::load($task);
|
||||
$days = LoadDays::load();
|
||||
|
||||
foreach ($days as $d) {
|
||||
|
||||
|
||||
@@ -18,13 +18,11 @@ class Grapper
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$force = Nuh::$options['f'] ?? 0;
|
||||
|
||||
$task_id = Nuh::$options['task'] ?? 0;
|
||||
|
||||
$days = LoadDays::load();
|
||||
|
||||
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('id', $task_id)->get();
|
||||
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
|
||||
|
||||
foreach ($active_tournaments as $tournament) {
|
||||
|
||||
@@ -47,7 +45,7 @@ class Grapper
|
||||
|
||||
$url = Nuh::$options['base_url']."api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand(1);
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
@@ -59,7 +57,7 @@ class Grapper
|
||||
|
||||
foreach ($data['events'] as $event) {
|
||||
|
||||
$folder = app_path().Sofascore::$storage_path.$day.'/'.$event['tournament']['slug'].'/'.$event['slug'];
|
||||
$folder = Sofascore::$grapper_path.$day.'/'.$event['tournament']['slug'].'/'.$event['slug'];
|
||||
|
||||
File::makeDirectory($folder, 0775, true, true);
|
||||
|
||||
@@ -75,7 +73,7 @@ class Grapper
|
||||
|
||||
$event_id = $event['id'];
|
||||
|
||||
if(!File::exists($folder.'/statistics.json') || $force){
|
||||
if(!File::exists($folder.'/statistics.json')){
|
||||
|
||||
$url = Nuh::$options['base_url']."api/v1/event/$event_id/statistics";
|
||||
|
||||
@@ -92,7 +90,7 @@ class Grapper
|
||||
* EVENT lineups
|
||||
*********************************/
|
||||
|
||||
if(!File::exists($folder.'/lineups.json') || $force){
|
||||
if(!File::exists($folder.'/lineups.json')){
|
||||
|
||||
$url = Nuh::$options['base_url']."api/v1/event/$event_id/lineups";
|
||||
|
||||
@@ -109,7 +107,7 @@ class Grapper
|
||||
* EVENT odds
|
||||
*********************************/
|
||||
|
||||
if(!File::exists($folder.'/odds.json') || $force){
|
||||
if(!File::exists($folder.'/odds.json')){
|
||||
|
||||
$url = Nuh::$options['base_url']."api/v1/event/$event_id/odds/1/all";
|
||||
|
||||
@@ -126,7 +124,7 @@ class Grapper
|
||||
* EVENT incidents
|
||||
*********************************/
|
||||
|
||||
if(!File::exists($folder.'/incidents.json') || $force){
|
||||
if(!File::exists($folder.'/incidents.json')){
|
||||
|
||||
$url = Nuh::$options['base_url']."api/v1/event/$event_id/incidents";
|
||||
|
||||
@@ -139,10 +137,10 @@ class Grapper
|
||||
File::put($folder.'/incidents.json', json_encode($data));
|
||||
}
|
||||
}
|
||||
Notice::note('one day and one tournament done ', 'bb', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Notice::note('tournament done', 'bb', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ class Sleeper
|
||||
}
|
||||
|
||||
if ($langsam) {
|
||||
$sleep = rand(500000, 50000000);
|
||||
$sleep = rand(2000000, 60000000);
|
||||
} else {
|
||||
$sleep = rand(500000, 1000000);
|
||||
}
|
||||
|
||||
@@ -2,38 +2,48 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper\Sofascore;
|
||||
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class SendMail
|
||||
{
|
||||
public static function run()
|
||||
{
|
||||
$task = Nuh::$options['task'] ?? 0;
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$days = LoadDays::load($task);
|
||||
$days = LoadDays::load();
|
||||
|
||||
foreach ($days as $d) {
|
||||
|
||||
$day = $d['day'];
|
||||
|
||||
$zip_file = Sofascore::$storage_path.'/'.$day.'.zip';
|
||||
$zip_file = storage_path('zip_sofascore_data').'/'.$day.'.zip';
|
||||
|
||||
Mail::send([], [], function ($message) use ($day, $zip_file) {
|
||||
if(File::exists($zip_file)){
|
||||
|
||||
$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',
|
||||
]);
|
||||
});
|
||||
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)
|
||||
->subject("sofa archive $day")
|
||||
->attach($zip_file, [
|
||||
'mime' => 'application/x-zip-compressed',
|
||||
'as' => 'sofa archive '.$day.'.zip',
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Notice::note('Mail send', 'g');
|
||||
if($debug){
|
||||
Notice::note('Mail send', 'g');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class Nuh extends Command
|
||||
$txt .= '--b block update (reload all for txodds)' . PHP_EOL;
|
||||
$txt .= '--d debug' . PHP_EOL;
|
||||
$txt .= '--e echo client data' . PHP_EOL;
|
||||
$txt .= '--f force (whatever in script)' . PHP_EOL;
|
||||
$txt .= '--f force (what ever in script)' . PHP_EOL;
|
||||
$txt .= '--g by minor groups (tx)' . PHP_EOL;
|
||||
$txt .= '--t load today' . PHP_EOL;
|
||||
$txt .= '--m mail it' . PHP_EOL;
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"eventState":[],"tournament":{"name":"Chinese Super League","slug":"chinese-super-league","category":{"name":"China","slug":"china","sport":{"name":"Football","slug":"football","id":1},"priority":0,"country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":99,"flag":"china","alpha2":"CN","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0635\u064a\u0646","ru":"\u041a\u0438\u0442\u0430\u0439"},"shortNameTranslation":[]}},"uniqueTournament":{"name":"Chinese Super League","slug":"cfa-super-league","primaryColorHex":"#f16327","secondaryColorHex":"#bc0416","category":{"name":"China","slug":"china","sport":{"name":"Football","slug":"football","id":1},"priority":0,"country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":99,"flag":"china","alpha2":"CN","fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u0635\u064a\u0646","ru":"\u041a\u0438\u0442\u0430\u0439"},"shortNameTranslation":[]}},"userCount":18399,"hasPerformanceGraphFeature":false,"country":[],"id":649,"hasEventPlayerStatistics":true,"displayInverseHomeAwayTeams":false,"fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u062f\u0648\u0631\u064a \u0627\u0644\u0635\u064a\u0646\u064a \u0627\u0644\u0645\u0645\u062a\u0627\u0632","bn":"\u099a\u09be\u0987\u09a8\u09bf\u099c \u09b8\u09c1\u09aa\u09be\u09b0 \u09b2\u09c0\u0997","hi":"\u091a\u093e\u0907\u0928\u0940\u091c\u093c \u0938\u0941\u092a\u0930 \u0932\u0940\u0917","ru":"\u0421\u0443\u043f\u0435\u0440\u043b\u0438\u0433\u0430 \u041a\u0438\u0442\u0430\u044f"},"shortNameTranslation":[]}},"priority":314,"isGroup":false,"isLive":false,"id":652,"fieldTranslations":{"nameTranslation":{"ar":"\u0627\u0644\u062f\u0648\u0631\u064a \u0627\u0644\u0635\u064a\u0646\u064a \u0627\u0644\u0645\u0645\u062a\u0627\u0632","bn":"\u099a\u09be\u0987\u09a8\u09bf\u099c \u09b8\u09c1\u09aa\u09be\u09b0 \u09b2\u09c0\u0997","hi":"\u091a\u093e\u0907\u0928\u0940\u095b \u0938\u0941\u092a\u0930 \u0932\u0940\u0917","ru":"\u0421\u0443\u043f\u0435\u0440\u043b\u0438\u0433\u0430 \u041a\u0438\u0442\u0430\u044f"},"shortNameTranslation":[]}},"season":{"name":"Chinese Super League 2026","year":"2026","editor":false,"id":90049},"roundInfo":{"round":16},"customId":"VTnsQZOd","status":{"code":100,"description":"Ended","type":"finished"},"winnerCode":1,"venue":{"city":{"name":"Qingdao","country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":30433},"venueCoordinates":{"latitude":120.36939,"longitude":36.06605},"hidden":true,"slug":"qingdao-youth-football-stadium","name":"Qingdao Youth Football Stadium","capacity":50000,"country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":39712,"fieldTranslations":{"nameTranslation":{"ar":"\u0645\u0644\u0639\u0628 \u062a\u0634\u064a\u0646\u063a\u062f\u0627\u0648 \u0644\u0644\u0634\u0628\u0627\u0628 \u0644\u0643\u0631\u0629 \u0627\u0644\u0642\u062f\u0645","hi":"\u0915\u093c\u093f\u0902\u0917\u0926\u093e\u0913 \u092f\u0941\u0925 \u092b\u0941\u091f\u092c\u0949\u0932 \u0938\u094d\u091f\u0947\u0921\u093f\u092f\u092e","bn":"\u0995\u09bf\u0982\u09a1\u09be\u0993 \u0987\u09df\u09c1\u09a5 \u09ab\u09c1\u099f\u09ac\u09b2 \u09b8\u09cd\u099f\u09c7\u09a1\u09bf\u09af\u09bc\u09be\u09ae"},"shortNameTranslation":[]},"stadium":{"name":"Qingdao Youth Football Stadium","capacity":50000}},"homeTeam":{"name":"Qingdao Hainiu","slug":"qingdao-hainiu","shortName":"Hainiu","gender":"M","sport":{"name":"Football","slug":"football","id":1},"userCount":7779,"nameCode":"QIN","disabled":false,"national":false,"type":0,"country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":34695,"subTeams":[],"teamColors":{"primary":"#ffffff","secondary":"#f85000","text":"#f85000"},"fieldTranslations":{"nameTranslation":{"ar":"\u062a\u0634\u064a\u0646\u063a\u062f\u0627\u0648 \u0647\u0627\u064a\u0646\u064a\u064a\u0648","ru":"\u0426\u0438\u043d\u0434\u0430\u043e \u041c\u0430\u043d\u0430\u0442\u0438"},"shortNameTranslation":{"ar":"\u0647\u0627\u064a\u0646\u064a\u064a\u0648"}}},"awayTeam":{"name":"Yunnan Yukun","slug":"yunnan-yukun","shortName":"Yukun","gender":"M","sport":{"name":"Football","slug":"football","id":1},"userCount":9177,"nameCode":"YUN","disabled":false,"national":false,"type":0,"country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":474991,"subTeams":[],"teamColors":{"primary":"#374df5","secondary":"#374df5","text":"#ffffff"},"fieldTranslations":{"nameTranslation":{"ar":"\u064a\u0648\u0646\u0627\u0646 \u064a\u0648\u0643\u064a\u0646","ru":"\u042e\u043d\u044c\u043d\u0430\u043d\u044c \u042e\u043a\u0443\u043d"},"shortNameTranslation":{"ar":"\u064a\u0648\u0646\u0627\u0646 \u064a\u0648\u0643\u064a\u0646","ru":"\u042e\u043a\u0443\u043d"}}},"homeScore":{"current":4,"display":4,"period1":4,"period2":0,"normaltime":4},"awayScore":{"current":2,"display":2,"period1":2,"period2":0,"normaltime":2},"time":{"injuryTime1":6,"injuryTime2":9,"currentPeriodStartTimestamp":1782477684},"changes":{"changes":["status.code","status.description","statusLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"incidents":[{"text":"FT","homeScore":4,"awayScore":2,"isLive":false,"time":90,"addedTime":999,"timeSeconds":5400,"reversedPeriodTime":1,"reversedPeriodTimeSeconds":0,"periodTimeSeconds":2700,"incidentType":"period"},{"player":{"name":"Pengfei Mu","slug":"pengfei-mou","shortName":"P. Mu","position":"G","jerseyNumber":"28","height":193,"userCount":10,"gender":"M","id":834786,"marketValueCurrency":"EUR","dateOfBirthTimestamp":604627200,"proposedMarketValueRaw":{"value":26000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0628\u064a\u0646\u063a\u0641\u064a \u0645\u0648","ru":"\u041f\u044d\u043d\u0444\u044d\u0439 \u041c\u0443"},"shortNameTranslation":{"ar":"\u0628. \u0645\u0648","ru":"\u041f. \u041c\u0443"}}},"playerName":"Pengfei Mu","reason":"Time wasting","rescinded":false,"id":125311276,"time":90,"addedTime":2,"isHome":true,"incidentClass":"yellow","reversedPeriodTime":1,"incidentType":"card"},{"length":9,"time":90,"addedTime":0,"reversedPeriodTime":1,"incidentType":"injuryTime"},{"player":{"name":"Zichang Huang","slug":"zichang-huang","shortName":"Z. Huang","position":"D","jerseyNumber":"19","height":170,"userCount":44,"gender":"M","id":873898,"marketValueCurrency":"EUR","dateOfBirthTimestamp":860112000,"proposedMarketValueRaw":{"value":210000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0632\u064a\u0634\u0627\u0646\u063a \u0647\u0648\u0627\u0646\u063a","ru":"\u0426\u0437\u0438\u0447\u0430\u043d \u0425\u0443\u0430\u043d"},"shortNameTranslation":{"ar":"\u0632. \u0647\u0648\u0627\u0646\u063a","ru":"\u0426. \u0425\u0443\u0430\u043d"}}},"playerName":"Zichang Huang","reason":"Foul","rescinded":false,"id":125311274,"time":89,"isHome":false,"incidentClass":"yellow","reversedPeriodTime":2,"incidentType":"card"},{"playerIn":{"name":"Zilong Han","slug":"zilong-han","shortName":"Z. Han","position":"M","jerseyNumber":"27","height":181,"userCount":9,"id":928157,"marketValueCurrency":"EUR","dateOfBirthTimestamp":765504000,"proposedMarketValueRaw":{"value":81000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0632\u064a\u0644\u0648\u0646\u063a \u0647\u0627\u0646","ru":"\u0417\u0438\u043b\u043e\u043d\u0433 \u0425\u0430\u043d"},"shortNameTranslation":{"ar":"\u0632. \u0647\u0627\u0646","ru":"\u0417. \u0425\u0430\u043d"}}},"playerOut":{"name":"Chugui Ye","slug":"chugui-ye","shortName":"C. Ye","position":"M","jerseyNumber":"7","height":178,"userCount":24,"gender":"M","id":792267,"marketValueCurrency":"EUR","dateOfBirthTimestamp":778982400,"proposedMarketValueRaw":{"value":92000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u064a\u064a\u060c \u062a\u0634\u0648\u063a\u0648\u064a","ru":"\u0415 \u0427\u0443\u0433\u0443\u0439"},"shortNameTranslation":{"ar":"\u062a. \u064a\u064a","ru":"\u0415. \u0427\u0443\u0433\u0443\u0439"}}},"id":126427453,"time":85,"injury":false,"isHome":false,"incidentClass":"regular","reversedPeriodTime":6,"incidentType":"substitution"},{"playerIn":{"name":"Liu Guobao","firstName":"Liu Guobao","lastName":"","slug":"liu-guobao","shortName":"L. Guobao","position":"F","jerseyNumber":"21","height":180,"userCount":11,"gender":"M","id":1210256,"marketValueCurrency":"EUR","dateOfBirthTimestamp":1051660800,"proposedMarketValueRaw":{"value":26000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0644\u064a\u0648 \u0642\u0648\u0628\u0627\u0648","ru":"\u041b\u044e \u0413\u0443\u043e\u0431\u0430\u043e"},"shortNameTranslation":{"ar":"\u0644. \u0642\u0648\u0628\u0627\u0648","ru":"\u041b. \u0413\u0443\u043e\u0431\u0430\u043e"}}},"playerOut":{"name":"Ahmed El Messaoudi","slug":"ahmed-el-messaoudi","shortName":"A. E. Messaoudi","position":"M","jerseyNumber":"11","height":182,"userCount":174,"gender":"M","id":369798,"marketValueCurrency":"EUR","dateOfBirthTimestamp":807408000,"proposedMarketValueRaw":{"value":635000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0623\u062d\u0645\u062f \u0627\u0644\u0645\u0633\u0639\u0648\u062f\u064a","ru":"\u0410\u0445\u043c\u0435\u0434 \u042d\u043b\u044c \u041c\u0435\u0441\u0441\u0430\u0443\u0434\u0438"},"shortNameTranslation":{"ar":"\u0623. \u0627\u0644\u0645\u0633\u0639\u0648\u062f\u064a","ru":"\u0410. \u041c\u0435\u0441\u0441\u0430\u0443\u0434\u0438"}}},"id":126427450,"time":77,"injury":true,"isHome":true,"incidentClass":"injury","reversedPeriodTime":14,"incidentType":"substitution"},{"playerIn":{"name":"Hailong Li","slug":"hailong-li","shortName":"H. Li","position":"D","jerseyNumber":"16","height":181,"userCount":2,"gender":"M","id":844572,"marketValueCurrency":"EUR","dateOfBirthTimestamp":838944000,"proposedMarketValueRaw":{"value":72000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0644\u064a\u060c \u0647\u0627\u064a\u0644\u0648\u0646\u063a","ru":"\u041b\u0438, \u0425\u0430\u0439\u043b\u043e\u043d\u0433"},"shortNameTranslation":{"ar":"\u0647. \u0644\u064a","ru":"\u0425. \u041b\u0438"}}},"playerOut":{"name":"Qiao Wang","slug":"qiao-wang","shortName":"Q. WLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"confirmed":true,"home":{"players":[{"player":{"name":"Pengfei Mu","slug":"pengfei-mou","shortName":"P. Mu","position":"G","jerseyNumber":"28","height":193,"userCount":10,"gender":"M","sofascoreId":"rkv62m","country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":834786,"marketValueCurrency":"EUR","dateOfBirthTimestamp":604627200,"proposedMarketValueRaw":{"value":26000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u0628\u064a\u0646\u063a\u0641\u064a \u0645\u0648","ru":"\u041f\u044d\u043d\u0444\u044d\u0439 \u041c\u0443"},"shortNameTranslation":{"ar":"\u0628. \u0645\u0648","ru":"\u041f. \u041c\u0443"}}},"teamId":34695,"shirtNumber":28,"jerseyNumber":"28","position":"G","substitute":false,"statistics":{"totalPass":21,"accuratePass":13,"totalLongBalls":13,"accurateLongBalls":5,"goalAssist":0,"accurateOwnHalfPasses":12,"totalOwnHalfPasses":15,"accurateOppositionHalfPasses":1,"totalOppositionHalfPasses":6,"duelWon":2,"ballRecovery":7,"totalTackle":1,"wonTackle":1,"wasFouled":1,"goodHighClaim":2,"savedShotsFromInsideTheBox":1,"saves":2,"totalKeeperSweeper":1,"accurateKeeperSweeper":1,"minutesPlayed":90,"touches":29,"rating":6.4,"possessionLostCtrl":8,"totalBallCarriesDistance":35.480422258309,"ballCarriesCount":6,"totalProgression":0.39775361865624,"progressiveBallCarriesCount":0,"keeperSaveValue":0.0003,"ratingVersions":{"original":6.4,"alternative":6.9},"totalShots":0,"passValueNormalized":0.03,"dribbleValueNormalized":0,"defensiveValueNormalized":-0.07,"goalkeeperValueNormalized":-0.63,"statisticsType":{"sportSlug":"football","statisticsType":"player"}}},{"player":{"name":"Qiao Wang","slug":"qiao-wang","shortName":"Q. Wang","position":"D","jerseyNumber":"17","height":170,"userCount":1,"gender":"M","sofascoreId":"ihiqne","country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":833755,"marketValueCurrency":"EUR","dateOfBirthTimestamp":811555200,"proposedMarketValueRaw":{"value":78000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u062a\u0634\u064a\u0627\u0648 \u0648\u0627\u0646\u063a","ru":"\u0426\u044f\u043e \u0412\u0430\u043d"},"shortNameTranslation":{"ar":"\u062a. \u0648\u0627\u0646\u063a","ru":"\u0426. \u0412\u0430\u043d"}}},"teamId":34695,"shirtNumber":17,"jerseyNumber":"17","position":"D","substitute":false,"statistics":{"totalPass":26,"accuratePass":24,"totalLongBalls":2,"accurateLongBalls":1,"goalAssist":0,"accurateOwnHalfPasses":10,"totalOwnHalfPasses":12,"accurateOppositionHalfPasses":14,"totalOppositionHalfPasses":14,"totalCross":6,"accurateCross":1,"duelLost":4,"duelWon":4,"challengeLost":2,"totalContest":1,"wonContest":1,"totalClearance":1,"outfielderBlock":2,"ballRecovery":3,"totalTackle":3,"wonTackle":2,"unsuccessfulTouch":2,"fouls":2,"minutesPlayed":73,"touches":47,"rating":6.5,"possessionLostCtrl":10,"totalBallCarriesDistance":110.88025341816,"ballCarriesCount":18,"totalProgression":16.681954768051,"bestBallCarryProgression":13.52742624452,"totalProgressiveBallCarriesDistance":19.896311442074,"progressiveBallCarriesCount":1,"ratingVersions":{"original":6.5,"alternative":6.8},"totalShots":0,"passValueNormalized":0.02,"dribbleValueNormalized":-0.19,"defensiveValueNormalized":-0.23,"statisticsType":{"sportSlug":"football","statisticsType":"player"}}},{"player":{"name":"Yangyang Jin","firstName":"","lastName":"","slug":"yangyang-jin","shortName":"Y. Jin","position":"D","jerseyNumber":"4","height":192,"userCount":4,"gender":"M","sofascoreId":"vk2rys","country":{"alpha2":"CN","alpha3":"CHN","name":"China","slug":"china"},"id":790827,"marketValueCurrency":"EUR","dateOfBirthTimestamp":728697600,"proposedMarketValueRaw":{"value":52000,"currency":"EUR"},"fieldTranslations":{"nameTranslation":{"ar":"\u064a\u0627\u0646\u063a \u064a\u0627\u0646\u063a \u062c\u064a\u0646","ru":"\u042f\u043d\u0446\u0437\u044f\u043d\u044c \u0426\u0437\u0438\u043d\u044c"},"shortNameTranslation":{"ar":"\u064a. \u062c\u064a\u0646","ru":"\u042f. \u0426\u0437\u0438\u043d\u044c"}}},"teamId":34695,"shirtNumber":4,"jerseyNumber":"4","position":"D","substitute":false,"statistics":{"totalPass":49,"accuratePass":41,"totalLongBalls":14,"accurateLongBalls":9,"goalAssist":0,"accurateOwnHalfPasses":26,"totalOwnHalfPasses":29,"accurateOppositionHalfPasses":15,"totalOppositionHalfPasses":20,"aerialLost":2,"duelLost":3,"duelWon":3,"totalClearance":7,"interceptionWon":3,"ballRecovery":7,"totalTackle":3,"wonTackle":1,"unsuccessfulTouch":1,"fouls":1,"minutesPlayed":90,"touches":65,"rating":7,"possessionLostCtrl":9,"totalBallCarriesDistance":195.39992077268,"ballCarriesCount":28,"totalProgression":27.126234293721,"progressiveBallCarriesCount":0,"ratingVersions":{"original":7,"alternative":7},"totalShots":0,"passValueNormalized":0.26,"dribbleValueNormalized":0.2,"defensiveValueNormalized":-0.09,"statisticsType":{"sportSlug":"football","statisticsType":"player"}}},{"player":{"name":"Nemanja An\u0111elkovi\u0107","firstName":"","lastName":"","slug":"nemanja-andelkovic","shortNamLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"markets":[{"sourceId":195608390,"structureType":1,"marketId":1,"marketName":"Full time","isLive":false,"fid":195608390,"suspended":false,"id":322374071,"marketGroup":"1X2","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"29\/20","fractionalValue":"91\/50","sourceId":1416209919,"name":"1","winning":true,"change":1},{"initialFractionalValue":"13\/5","fractionalValue":"11\/4","sourceId":1416209920,"name":"X","winning":false,"change":1},{"initialFractionalValue":"29\/20","fractionalValue":"5\/4","sourceId":1416209921,"name":"2","winning":false,"change":-1}]},{"sourceId":195608390,"structureType":1,"marketId":2,"marketName":"Double chance","isLive":false,"fid":195608390,"suspended":false,"id":327573176,"marketGroup":"Double chance","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"1\/2","fractionalValue":"4\/7","sourceId":1416337608,"name":"1X","winning":true,"change":1},{"initialFractionalValue":"1\/2","fractionalValue":"2\/5","sourceId":1416337586,"name":"X2","winning":false,"change":-1},{"initialFractionalValue":"2\/7","fractionalValue":"1\/4","sourceId":1416337606,"name":"12","winning":true,"change":-1}]},{"sourceId":195608390,"structureType":1,"marketId":3,"marketName":"1st half","isLive":false,"fid":195608390,"suspended":false,"id":327573177,"marketGroup":"1X2","marketPeriod":"1st half","choices":[{"initialFractionalValue":"2\/1","fractionalValue":"11\/5","sourceId":1416337554,"name":"1","winning":true,"change":1},{"initialFractionalValue":"7\/5","fractionalValue":"7\/5","sourceId":1416337560,"name":"X","winning":false,"change":0},{"initialFractionalValue":"2\/1","fractionalValue":"7\/4","sourceId":1416337565,"name":"2","winning":false,"change":-1}]},{"sourceId":195608390,"structureType":1,"marketId":4,"marketName":"Draw no bet","isLive":false,"fid":195608390,"suspended":false,"id":327573178,"marketGroup":"Draw no bet","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"5\/6","fractionalValue":"11\/10","sourceId":1416337927,"name":"1","winning":true,"change":1},{"initialFractionalValue":"5\/6","fractionalValue":"4\/6","sourceId":1416337935,"name":"2","winning":false,"change":-1}]},{"sourceId":195608390,"structureType":1,"marketId":5,"marketName":"Both teams to score","isLive":false,"fid":195608390,"suspended":false,"id":327573179,"marketGroup":"Both teams to score","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"1\/2","fractionalValue":"1\/2","sourceId":1416362279,"name":"Yes","winning":true,"change":0},{"initialFractionalValue":"6\/4","fractionalValue":"6\/4","sourceId":1416362280,"name":"No","winning":false,"change":0}]},{"sourceId":195608390,"structureType":2,"marketId":9,"marketName":"Match goals","choiceGroup":"0.5","isLive":false,"fid":195608390,"suspended":false,"id":327573189,"marketGroup":"Match goals","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"1\/40","fractionalValue":"1\/40","sourceId":1416362298,"name":"Over","winning":true,"change":0},{"initialFractionalValue":"16\/1","fractionalValue":"16\/1","sourceId":1416362310,"name":"Under","winning":false,"change":0}]},{"sourceId":195608390,"structureType":2,"marketId":9,"marketName":"Match goals","choiceGroup":"1.5","isLive":false,"fid":195608390,"suspended":false,"id":327573188,"marketGroup":"Match goals","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"1\/6","fractionalValue":"1\/6","sourceId":1416362315,"name":"Over","winning":true,"change":0},{"initialFractionalValue":"4\/1","fractionalValue":"4\/1","sourceId":1416362306,"name":"Under","winning":false,"change":0}]},{"sourceId":195608390,"structureType":2,"marketId":9,"marketName":"Match goals","choiceGroup":"2.5","isLive":false,"fid":195608390,"suspended":false,"id":327573182,"marketGroup":"Match goals","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"7\/5","fractionalValue":"8\/15","sourceId":1416209922,"name":"Over","winning":true,"change":-1},{"initialFractionalValue":"8\/15","fractionalValue":"7\/5","sourceId":1416209923,"name":"Under","winning":false,"change":1}]},{"sourceId":195608390,"structureType":2,"marketId":9,"marketName":"Match goals","choiceGroup":"3.5","isLive":false,"fid":195608390,"suspended":false,"id":327573187,"marketGroup":"Match goals","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"5\/4","fractionalValue":"5\/4","sourceId":1416362302,"name":"Over","winning":true,"change":0},{"initialFractionalValue":"4\/7","fractionalValue":"4\/7","sourceId":1416362319,"name":"Under","winning":false,"change":0}]},{"sourceId":195608390,"structureType":2,"marketId":9,"marketName":"Match goals","choiceGroup":"4.5","isLive":false,"fid":195608390,"suspended":false,"id":327573186,"marketGroup":"Match goals","marketPeriod":"Full-time","choices":[{"initialFractionalValue":"3\/1","fractionalValue":"3\/1","sourceId":1416362321,"name":"Over","winning":true,"change":0},{"initialFractionalValue":"2\/9","fractionalValue":"2\/9","sourceId":1416362307,"name":"Under","winning"Line truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
{"statistics":[{"period":"ALL","groups":[{"groupName":"Match overview","statisticsItems":[{"name":"Ball possession","home":"47%","away":"53%","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":47,"awayValue":53,"renderType":2,"key":"ballPossession"},{"name":"Expected goals","home":"2.15","away":"2.57","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":2.15,"awayValue":2.57,"renderType":1,"key":"expectedGoals"},{"name":"Big chances","home":"3","away":"3","compareCode":3,"statisticsType":"positive","valueType":"event","homeValue":3,"awayValue":3,"renderType":1,"key":"bigChanceCreated"},{"name":"Total shots","home":"8","away":"20","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":8,"awayValue":20,"renderType":1,"key":"totalShotsOnGoal"},{"name":"Goalkeeper saves","home":"2","away":"2","compareCode":3,"statisticsType":"positive","valueType":"event","homeValue":2,"awayValue":2,"renderType":1,"key":"goalkeeperSaves"},{"name":"Corner kicks","home":"2","away":"4","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":2,"awayValue":4,"renderType":1,"key":"cornerKicks"},{"name":"Fouls","home":"15","away":"14","compareCode":1,"statisticsType":"negative","valueType":"event","homeValue":15,"awayValue":14,"renderType":1,"key":"fouls"},{"name":"Passes","home":"374","away":"408","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":374,"awayValue":408,"renderType":1,"key":"passes"},{"name":"Tackles","home":"23","away":"19","compareCode":1,"statisticsType":"positive","valueType":"event","homeValue":23,"awayValue":19,"renderType":1,"key":"totalTackle"},{"name":"Free kicks","home":"14","away":"15","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":14,"awayValue":15,"renderType":1,"key":"freeKicks"},{"name":"Yellow cards","home":"4","away":"2","compareCode":1,"statisticsType":"negative","valueType":"event","homeValue":4,"awayValue":2,"renderType":1,"key":"yellowCards"}]},{"groupName":"Shots","statisticsItems":[{"name":"Total shots","home":"8","away":"20","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":8,"awayValue":20,"renderType":1,"key":"totalShotsOnGoal"},{"name":"Shots on target","home":"6","away":"4","compareCode":1,"statisticsType":"positive","valueType":"event","homeValue":6,"awayValue":4,"renderType":1,"key":"shotsOnGoal"},{"name":"Hit woodwork","home":"0","away":"0","compareCode":3,"statisticsType":"negative","valueType":"event","homeValue":0,"awayValue":0,"renderType":1,"key":"hitWoodwork"},{"name":"Shots off target","home":"1","away":"9","compareCode":2,"statisticsType":"negative","valueType":"event","homeValue":1,"awayValue":9,"renderType":1,"key":"shotsOffGoal"},{"name":"Blocked shots","home":"1","away":"7","compareCode":2,"statisticsType":"negative","valueType":"event","homeValue":1,"awayValue":7,"renderType":1,"key":"blockedScoringAttempt"},{"name":"Shots inside box","home":"6","away":"15","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":6,"awayValue":15,"renderType":1,"key":"totalShotsInsideBox"},{"name":"Shots outside box","home":"2","away":"5","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":2,"awayValue":5,"renderType":1,"key":"totalShotsOutsideBox"}]},{"groupName":"Attack","statisticsItems":[{"name":"Big chances scored","home":"3","away":"1","compareCode":1,"statisticsType":"positive","valueType":"event","homeValue":3,"awayValue":1,"renderType":1,"key":"bigChanceScored"},{"name":"Big chances missed","home":"0","away":"2","compareCode":2,"statisticsType":"negative","valueType":"event","homeValue":0,"awayValue":2,"renderType":1,"key":"bigChanceMissed"},{"name":"Touches in penalty area","home":"25","away":"34","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":25,"awayValue":34,"renderType":1,"key":"touchesInOppBox"},{"name":"Fouled in final third","home":"0","away":"3","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":0,"awayValue":3,"renderType":1,"key":"fouledFinalThird"},{"name":"Offsides","home":"2","away":"2","compareCode":3,"statisticsType":"negative","valueType":"event","homeValue":2,"awayValue":2,"renderType":1,"key":"offsides"}]},{"groupName":"Passes","statisticsItems":[{"name":"Accurate passes","home":"308","away":"339","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":308,"awayValue":339,"renderType":1,"key":"accuratePasses"},{"name":"Throw-ins","home":"16","away":"26","compareCode":2,"statisticsType":"positive","valueType":"event","homeValue":16,"awayValue":26,"renderType":1,"key":"throwIns"},{"name":"Final third entries","home":"47","away":"47","compareCode":3,"statisticsType":"positive","valueType":"event","homeValue":47,"awayValue":47,"renderType":1,"key":"finalThirdEntries"},{"name":"Final third phase","home":"82\/111 (74%)","away":"74\/118 (63%)","compareCode":1,"statisticsType":"positive","valLine truncated
|
||||
+14
-11
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use App\Console\Commands\Grapper\Sofascore\Special;
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use ZipArchive;
|
||||
@@ -11,24 +11,27 @@ class ZipFolder
|
||||
{
|
||||
public static function create(string $day){
|
||||
|
||||
$zipFilePath = Special::$storage_path.'/'.$day.'.zip';
|
||||
$zipFilePath = storage_path('zip_sofascore_data').'/'.$day.'.zip';
|
||||
|
||||
Special::$source_path .= '/'.$day;
|
||||
$path = Sofascore::$grapper_path.$day;
|
||||
|
||||
$zip = new ZipArchive();
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === true) {
|
||||
|
||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(Special::$source_path));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen(Special::$source_path) + 1);
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
if(is_dir($path)){
|
||||
|
||||
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
||||
|
||||
foreach ($files as $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen($path) + 1);
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
}
|
||||
$zip->close();
|
||||
} else {
|
||||
return response()->json(['error' => 'Failed to create ZIP archive'], 500);
|
||||
}
|
||||
|
||||
+25
-52
@@ -1,29 +1,36 @@
|
||||
case "$1" in
|
||||
"1")
|
||||
# AUTO GRAPPER SOFASCORE (debug)
|
||||
echo "\n⚽ close all open vpn"
|
||||
|
||||
echo "\n⚽ close all vpn"
|
||||
killall ssh
|
||||
|
||||
echo "\n⚽ open vpn tunnel to prod"
|
||||
echo "\n⚽ open vpn"
|
||||
ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
|
||||
|
||||
echo "\n⚽ copy active tournaments"
|
||||
php artisan nuh --d --f 67 --fun=2 --task=1
|
||||
echo "\n⚽ copy settings"
|
||||
php artisan nuh --d --f 67 --fun=2 --task=$2
|
||||
|
||||
echo "\n⚽ close tunnel"
|
||||
echo "\n⚽ close vpn"
|
||||
killall ssh
|
||||
|
||||
echo "\n⚽ grap avilable tournaments for given days"
|
||||
php artisan nuh --d --f 67 --fun=5 --task=1
|
||||
echo "\n⚽ start task"
|
||||
php artisan nuh --d --f 67 --fun=7 --task=$2
|
||||
|
||||
echo "\n⚽ grapp data sofascore"
|
||||
php artisan nuh --d --f 67 --fun=6 --task=1
|
||||
echo "\n⚽ tournaments for day"
|
||||
php artisan nuh --d --f 67 --fun=5 --task=$2
|
||||
|
||||
echo "\n⚽ grapper events"
|
||||
php artisan nuh --d --f 67 --fun=6 --task=$2
|
||||
|
||||
echo "\n⚽ create zip archive"
|
||||
php artisan nuh --d --f 67 --fun=3 --task=1
|
||||
php artisan nuh --d --f 67 --fun=3 --task=$2
|
||||
|
||||
echo "\n⚽ mail archive"
|
||||
php artisan nuh --d --f 67 --fun=4 --task=1
|
||||
php artisan nuh --d --f 67 --fun=4 --task=$2
|
||||
|
||||
echo "\n⚽ end task"
|
||||
php artisan nuh --d --f 67 --fun=8 --task=$2
|
||||
|
||||
echo "\n😎 done :)"
|
||||
;;
|
||||
@@ -31,47 +38,14 @@ case "$1" in
|
||||
# AUTO GRAPPER SOFASCORE (production no debug and 10s breaks)
|
||||
killall ssh
|
||||
ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
|
||||
php artisan nuh --f 67 --fun=2 --task=1
|
||||
php artisan nuh --f 67 --fun=2 --task=$2
|
||||
killall ssh
|
||||
php artisan nuh --f 67 --fun=5 --task=1
|
||||
php artisan nuh --f 67 --fun=6 --task=1
|
||||
php artisan nuh --f 67 --fun=3 --task=1
|
||||
php artisan nuh --f 67 --fun=4 --task=1
|
||||
;;
|
||||
"3")
|
||||
# AUTO GRAPPER SOFASCORE (debug)
|
||||
|
||||
# echo "\n⚽ close all vpn"
|
||||
# killall ssh
|
||||
|
||||
# echo "\n⚽ open vpn"
|
||||
# ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190
|
||||
|
||||
# echo "\n⚽ copy settings"
|
||||
# php artisan nuh --d --f 67 --fun=2 --task=2
|
||||
|
||||
# echo "\n⚽ close vpn"
|
||||
# killall ssh
|
||||
|
||||
# echo "\n⚽ start task"
|
||||
# php artisan nuh --d --f 67 --fun=7 --task=2
|
||||
|
||||
# echo "\n⚽ tournaments for day"
|
||||
# php artisan nuh --d --f 67 --fun=5 --task=2
|
||||
|
||||
echo "\n⚽ grapper events"
|
||||
php artisan nuh --d --f 67 --fun=6 --task=2
|
||||
|
||||
# echo "\n⚽ create zip archive"
|
||||
# php artisan nuh --d --f 67 --fun=3 --task=2
|
||||
|
||||
# echo "\n⚽ mail archive"
|
||||
# php artisan nuh --d --f 67 --fun=4 --task=2
|
||||
|
||||
# echo "\n⚽ end task"
|
||||
# php artisan nuh --d --f 67 --fun=8 --task=2
|
||||
|
||||
echo "\n😎 done :)"
|
||||
php artisan nuh --f 67 --fun=7 --task=$2
|
||||
php artisan nuh --f 67 --fun=5 --task=$2
|
||||
php artisan nuh --f 67 --fun=6 --task=$2
|
||||
php artisan nuh --f 67 --fun=3 --task=$2
|
||||
php artisan nuh --f 67 --fun=4 --task=$2
|
||||
php artisan nuh --f 67 --fun=8 --task=$2
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
@@ -80,7 +54,6 @@ case "$1" in
|
||||
echo "--------------------------"
|
||||
echo "1 => debug max 5sec intervals | print notes | yesterday | soccer task_id:1"
|
||||
echo "2 => prod max 10sec intervals | no notes | yesterday | soccer | task_id:1"
|
||||
echo "3 => debug max 5sec intervals | print notes | manual dates or range | soccer | task_id:2"
|
||||
echo "--------------------------"
|
||||
echo ""
|
||||
;;
|
||||
|
||||
+5
-5
@@ -14,8 +14,8 @@ return [
|
||||
*/
|
||||
|
||||
'component_locations' => [
|
||||
resource_path('views/components'),
|
||||
resource_path('views/livewire'),
|
||||
regrapper_path('views/components'),
|
||||
regrapper_path('views/livewire'),
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -30,8 +30,8 @@ return [
|
||||
*/
|
||||
|
||||
'component_namespaces' => [
|
||||
'layouts' => resource_path('views/layouts'),
|
||||
'pages' => resource_path('views/pages'),
|
||||
'layouts' => regrapper_path('views/layouts'),
|
||||
'pages' => regrapper_path('views/pages'),
|
||||
],
|
||||
|
||||
/*
|
||||
@@ -115,7 +115,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'view_path' => resource_path('views/livewire'),
|
||||
'view_path' => regrapper_path('views/livewire'),
|
||||
|
||||
/*
|
||||
|---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user