wip ss
This commit is contained in:
1 parent
57c695c247
commit
d4dfb9748c
19 files changed
+269
-7252
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper;
|
||||
|
||||
use App\Console\Commands\Grapper\Sportscore\Helper;
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Models\Sport;
|
||||
|
||||
class Sofascore
|
||||
{
|
||||
public static $auth_header = [];
|
||||
|
||||
public static $base_url = '';
|
||||
|
||||
public static $sport = [];
|
||||
|
||||
public static function switch()
|
||||
{
|
||||
self::$sport = Helper::map();
|
||||
|
||||
dd(self::$sport, Nuh::$options);
|
||||
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$echo_data = Nuh::$options['e'] ?? 0;
|
||||
|
||||
$sportmap = Sport::map('logi', 1, [Nuh::$options['sport_id']]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Sportscore;
|
||||
|
||||
class Helper
|
||||
{
|
||||
// football
|
||||
// basketball
|
||||
// tennis
|
||||
// ice-hockey
|
||||
// baseball
|
||||
|
||||
public static function map()
|
||||
{
|
||||
return [
|
||||
1 => [
|
||||
'name' => 'Soccer',
|
||||
'slug' => 'football',
|
||||
],
|
||||
2 => [
|
||||
'name' => 'Basketball',
|
||||
'slug' => 'basketball',
|
||||
],
|
||||
4 => [
|
||||
'name' => 'Ice Hockey',
|
||||
'slug' => 'ice-hockey',
|
||||
],
|
||||
5 => [
|
||||
'name' => 'Tennis',
|
||||
'slug' => 'tennis',
|
||||
],
|
||||
64 => [
|
||||
'name' => 'Baseball',
|
||||
'slug' => 'baseball',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
* Get basic list of league_id for all days in 2026-06
|
||||
https://www.sofascore.com/api/v1/calendar/2026-06/7200/football/unique-tournaments
|
||||
|
||||
* with an ID and the date get all scheduled events for this day
|
||||
* almost all infos are in this link
|
||||
https://www.sofascore.com/api/v1/unique-tournament/152/scheduled-events/2026-06-01
|
||||
|
||||
|
||||
* Odds for events get ID from previouse link
|
||||
https://www.sofascore.com/api/v1/event/15235580/odds/1/all
|
||||
|
||||
|
||||
* All player info in dis link
|
||||
https://www.sofascore.com/api/v1/event/15235580/lineups
|
||||
@@ -8,6 +8,7 @@ use App\Console\Commands\Grapper\Betsapi;
|
||||
use App\Console\Commands\Grapper\Goldbet;
|
||||
use App\Console\Commands\Grapper\Logifuture;
|
||||
use App\Console\Commands\Grapper\Magloo;
|
||||
use App\Console\Commands\Grapper\Sofascore;
|
||||
use App\Console\Commands\Grapper\TxOdds;
|
||||
use App\Console\Commands\Services\Services;
|
||||
use App\Models\Supervisor;
|
||||
@@ -121,6 +122,10 @@ class Nuh extends Command
|
||||
// DB MAPPER
|
||||
AutoMapper::switch();
|
||||
break;
|
||||
case 12:
|
||||
// SOFASCORE
|
||||
Sofascore::switch();
|
||||
break;
|
||||
default:
|
||||
Notice::note('Provider not defined', 'r', 1);
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\SofaScoreResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateSofaScore extends CreateRecord
|
||||
{
|
||||
protected static string $resource = SofaScoreResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\SofaScoreResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditSofaScore extends EditRecord
|
||||
{
|
||||
protected static string $resource = SofaScoreResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\SofaScoreResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListSofaScores extends ListRecords
|
||||
{
|
||||
protected static string $resource = SofaScoreResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()->label('Download Job')
|
||||
->icon('phosphor-download'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class SofaScoreForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\Pages\ListSofaScores;
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\Schemas\SofaScoreForm;
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScores\Tables\SofaScoresTable;
|
||||
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||
use App\Models\SofaScoreEvent;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class SofaScoreResource extends Resource
|
||||
{
|
||||
protected static ?string $model = SofaScoreEvent::class;
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'SofaScoreEvent';
|
||||
|
||||
protected static ?string $navigationLabel = 'SofaScore Events';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'SofaScore';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return SofaScoreForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return SofaScoresTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListSofaScores::route('/'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScores\Tables;
|
||||
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class SofaScoresTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
//
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ use App\Filament\Clusters\StaticData\Resources\TxoddsMarkets\Schemas\TxoddsMarke
|
||||
use App\Filament\Clusters\StaticData\Resources\TxoddsMarkets\Tables\TxoddsMarketsTable;
|
||||
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||
use App\Models\TxoddsMarket;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
@@ -17,6 +18,8 @@ class TxoddsMarketResource extends Resource
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'phosphor-tree-structure';
|
||||
|
||||
protected static ?int $navigationSort = 32;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Markets';
|
||||
|
||||
@@ -7,10 +7,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Sport extends Model
|
||||
{
|
||||
public static function map($field, $reverse = false, $limit = [])
|
||||
public static function map(string $field, $reverse = false, $limit = [])
|
||||
{
|
||||
if (! in_array($field, ['bapi', 'bwin', 'b365', 'logi', 'magl'])) {
|
||||
Notice::note('Sport::map wrong option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1);
|
||||
if (! in_array($field, ['bapi', 'bwin', 'b365', 'logi', 'magl', 'sofascore'])) {
|
||||
Notice::note('Sport::map wrong option! Possible options: bapi, bwin, b365, logi, magl, sofascore', 'r', 1);
|
||||
}
|
||||
|
||||
if ($reverse) {
|
||||
@@ -33,7 +33,7 @@ class Sport extends Model
|
||||
return Sport::query()->where('is_active', 1)->pluck('id')->toArray();
|
||||
}
|
||||
|
||||
public static function getSportForClient($client_id)
|
||||
public static function getSportForClient(int $client_id)
|
||||
{
|
||||
$sports = Client::where('id', $client_id)->value('sport');
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ return new class extends Migration
|
||||
$table->integer('b365')->default(0);
|
||||
$table->integer('logi')->default(0);
|
||||
$table->integer('magl')->default(0);
|
||||
$table->integer('sofascore')->default(0);
|
||||
$table->boolean('is_active')->default(0);
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use MongoDB\Laravel\Schema\Blueprint;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
protected $connection = 'mongodb';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('sofascore_events', function (Blueprint $collection) {
|
||||
$collection->index('match_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('sofascore_events');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg viewBox="0 0 48 48" id="b" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<style>.c{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;}</style>
|
||||
</defs>
|
||||
<path class="c" d="m42.5317,5.5H5.5317v18.3469h9.0469v-9.4023h27.9531V5.5Z"/>
|
||||
<path class="c" d="m5.5317,42.5h37v-18.3469h-9.0469v9.4023H5.5317v8.9446Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 480 B |
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,120 +0,0 @@
|
||||
https: //www.sofascore.com/api/v1/event/13980110/player/893998/statistics
|
||||
{
|
||||
"player": {
|
||||
"name": "Luca Ranieri",
|
||||
"firstName": "Luca",
|
||||
"lastName": "Ranieri",
|
||||
"slug": "luca-ranieri",
|
||||
"shortName": "L. Ranieri",
|
||||
"position": "D",
|
||||
"jerseyNumber": "6",
|
||||
"height": 187,
|
||||
"userCount": 1149,
|
||||
"gender": "M",
|
||||
"id": 893998,
|
||||
"marketValueCurrency": "EUR",
|
||||
"dateOfBirthTimestamp": 924825600,
|
||||
"proposedMarketValueRaw": {
|
||||
"value": 6200000,
|
||||
"currency": "EUR"
|
||||
},
|
||||
"fieldTranslations": {
|
||||
"nameTranslation": {
|
||||
"ar": "\u0644\u0648\u0643\u0627 \u0631\u0627\u0646\u064a\u064a\u0631\u064a",
|
||||
"bn": "\u09b2\u09c1\u0995\u09be \u09b0\u09be\u09a8\u09bf\u09af\u09bc\u09c7\u09b0\u09bf",
|
||||
"hi": "\u0932\u0941\u0915\u093e \u0930\u093e\u0928\u093f\u090f\u0930\u0940"
|
||||
},
|
||||
"shortNameTranslation": {
|
||||
"ar": "\u0644. \u0631\u0627\u0646\u064a\u064a\u0631\u064a",
|
||||
"bn": "\u098f\u09b2. \u09b0\u09be\u09a8\u09bf\u09af\u09bc\u09c7\u09b0\u09bf",
|
||||
"hi": "\u090f\u0932. \u0930\u093e\u0928\u093f\u090f\u0930\u0940"
|
||||
}
|
||||
}
|
||||
},
|
||||
"team": {
|
||||
"name": "Fiorentina",
|
||||
"slug": "fiorentina",
|
||||
"shortName": "Fiorentina",
|
||||
"gender": "M",
|
||||
"sport": {
|
||||
"name": "Football",
|
||||
"slug": "football",
|
||||
"id": 1
|
||||
},
|
||||
"userCount": 315046,
|
||||
"nameCode": "FIO",
|
||||
"disabled": false,
|
||||
"national": false,
|
||||
"type": 0,
|
||||
"id": 2693,
|
||||
"teamColors": {
|
||||
"primary": "#542baa",
|
||||
"secondary": "#ffffff",
|
||||
"text": "#ffffff"
|
||||
},
|
||||
"fieldTranslations": {
|
||||
"nameTranslation": {
|
||||
"ar": "\u0641\u064a\u0648\u0631\u0646\u062a\u064a\u0646\u0627",
|
||||
"bn": "\u09ab\u09bf\u0993\u09b0\u09c7\u09a8\u09cd\u099f\u09bf\u09a8\u09be",
|
||||
"hi": "\u092b\u093f\u092f\u094b\u0930\u0947\u0902\u091f\u0940\u0928\u093e",
|
||||
"ru": "\u0424\u0438\u043e\u0440\u0435\u043d\u0442\u0438\u043d\u0430"
|
||||
},
|
||||
"shortNameTranslation": {
|
||||
"ar": "\u0641\u064a\u0648\u0631\u0646\u062a\u064a\u0646\u0627"
|
||||
}
|
||||
}
|
||||
},
|
||||
"statistics": {
|
||||
"totalPass": 59,
|
||||
"accuratePass": 53,
|
||||
"totalLongBalls": 7,
|
||||
"accurateLongBalls": 7,
|
||||
"goalAssist": 0,
|
||||
"accurateOwnHalfPasses": 23,
|
||||
"totalOwnHalfPasses": 25,
|
||||
"accurateOppositionHalfPasses": 30,
|
||||
"totalOppositionHalfPasses": 34,
|
||||
"totalCross": 1,
|
||||
"aerialWon": 3,
|
||||
"duelLost": 2,
|
||||
"duelWon": 5,
|
||||
"totalContest": 1,
|
||||
"blockedScoringAttempt": 1,
|
||||
"totalClearance": 4,
|
||||
"outfielderBlock": 1,
|
||||
"interceptionWon": 1,
|
||||
"ballRecovery": 4,
|
||||
"totalTackle": 1,
|
||||
"wonTackle": 1,
|
||||
"unsuccessfulTouch": 1,
|
||||
"wasFouled": 1,
|
||||
"fouls": 1,
|
||||
"minutesPlayed": 90,
|
||||
"touches": 72,
|
||||
"rating": 7.6,
|
||||
"possessionLostCtrl": 9,
|
||||
"expectedGoals": 0.0461,
|
||||
"expectedAssists": 0.0142134,
|
||||
"totalBallCarriesDistance": 135.6977791543,
|
||||
"ballCarriesCount": 15,
|
||||
"totalProgression": 43.815867162916,
|
||||
"bestBallCarryProgression": 18.868747236023,
|
||||
"totalProgressiveBallCarriesDistance": 33.412386266174,
|
||||
"progressiveBallCarriesCount": 1,
|
||||
"ratingVersions": {
|
||||
"original": 7.6,
|
||||
"alternative": 7.5
|
||||
},
|
||||
"totalShots": 1,
|
||||
"shotValueNormalized": -0.03,
|
||||
"passValueNormalized": 0.31,
|
||||
"dribbleValueNormalized": 0.05,
|
||||
"defensiveValueNormalized": 0.29,
|
||||
"statisticsType": {
|
||||
"sportSlug": "football",
|
||||
"statisticsType": "player"
|
||||
}
|
||||
},
|
||||
"position": "D",
|
||||
"extra": null
|
||||
}
|
||||
Reference in new issue
Block a user