wip
This commit is contained in:
1 parent
fc0f18ba73
commit
558430114a
11 files changed
+39
-76
No files matched your search
@@ -25,7 +25,6 @@ class DaysTournament
|
||||
|
||||
foreach ($days as $d) {
|
||||
|
||||
$langsam = $d['run_slow'];
|
||||
$sport_id = $d['sport_id'];
|
||||
$day = $d['day'];
|
||||
$slug = $d['slug'];
|
||||
@@ -48,7 +47,7 @@ class DaysTournament
|
||||
|
||||
$url = Nuh::$options['base_url'] . "api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand();
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
@@ -146,9 +145,9 @@ class DaysTournament
|
||||
]);
|
||||
$tournaments_counter++;
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('tournament: ' . $tournament['name'], 'p');
|
||||
}
|
||||
// if ($debug) {
|
||||
// Notice::note('tournament: ' . $tournament['name'], 'p');
|
||||
// }
|
||||
|
||||
/**
|
||||
* DAY TOURNAMENT
|
||||
|
||||
@@ -32,8 +32,6 @@ class Grapper
|
||||
|
||||
foreach ($days as $d) {
|
||||
|
||||
$langsam = $d['run_slow'];
|
||||
|
||||
$day = $d['day'];
|
||||
|
||||
$res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first();
|
||||
@@ -77,7 +75,7 @@ class Grapper
|
||||
|
||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand();
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
@@ -94,7 +92,7 @@ class Grapper
|
||||
|
||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand();
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
@@ -111,7 +109,7 @@ class Grapper
|
||||
|
||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand();
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
@@ -128,7 +126,7 @@ class Grapper
|
||||
|
||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
||||
|
||||
Sleeper::rand($langsam);
|
||||
Sleeper::rand();
|
||||
|
||||
$data = CurlSofa::load($url);
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ class LoadDays
|
||||
$dates[] = [
|
||||
'day' => Carbon::now()->subDay()->format('Y-m-d'),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'run_slow' => $task->run_slow,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
@@ -44,7 +43,6 @@ class LoadDays
|
||||
$dates[] = [
|
||||
'day' => self::validateDate($task->day_from),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'run_slow' => $task->run_slow,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
@@ -68,7 +66,6 @@ class LoadDays
|
||||
$dates[] = [
|
||||
'day' => $from->format('Y-m-d'),
|
||||
'slug' => $task->sport->ss_slug,
|
||||
'run_slow' => $task->run_slow,
|
||||
'sport_id' => $task->sport_id,
|
||||
'run_repeatedly' => $task->run_repeatedly,
|
||||
];
|
||||
|
||||
@@ -2,29 +2,15 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper\Sofascore\Helper;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Sleeper
|
||||
{
|
||||
public static function rand(bool $langsam = false)
|
||||
public static function rand($langsam = false)
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
if ($debug) {
|
||||
$langsam = false;
|
||||
}
|
||||
|
||||
if ($langsam) {
|
||||
$sleep = rand(2000000, 60000000);
|
||||
$sleep = rand(3000000, 6000000);
|
||||
} else {
|
||||
$sleep = rand(500000, 1000000);
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("sleeping $sleep msec", 'y');
|
||||
}
|
||||
|
||||
usleep($sleep);
|
||||
}
|
||||
}
|
||||
-1
@@ -49,7 +49,6 @@ class SofaScoreTasksTable
|
||||
->afterStateUpdated(function ($record) {
|
||||
SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]);
|
||||
}),
|
||||
ToggleColumn::make('run_slow')->alignCenter(),
|
||||
ToggleColumn::make('run_repeatedly')->alignCenter(),
|
||||
TextColumn::make('duration'),
|
||||
])
|
||||
|
||||
@@ -43,15 +43,15 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class EventsTable
|
||||
{
|
||||
public static $user;
|
||||
public static array $user;
|
||||
|
||||
public static $bettype_settings;
|
||||
public static array $bettype_settings;
|
||||
|
||||
public static $slots;
|
||||
public static array $slots;
|
||||
|
||||
public static $bookmaker;
|
||||
public static array $bookmaker;
|
||||
|
||||
public static $filter;
|
||||
public static array $filter;
|
||||
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
@@ -184,7 +184,7 @@ class EventsTable
|
||||
Hidden::make('filter_stars'),
|
||||
Hidden::make('filter_notes'),
|
||||
Hidden::make('filter_periode'),
|
||||
Select::make(name: 'country_id')
|
||||
Select::make('country_id')
|
||||
->placeholder('Country')
|
||||
->prefixIcon('phosphor-flag')
|
||||
->hiddenLabel()
|
||||
|
||||
@@ -9,8 +9,6 @@ use App\Models\MultilineSetting;
|
||||
|
||||
class LoadMultiline
|
||||
{
|
||||
public static $user;
|
||||
|
||||
public static function load()
|
||||
{
|
||||
$cb = ComparingBookmaker::where('sport_id', auth()->user()->sport_id)
|
||||
|
||||
@@ -18,7 +18,6 @@ class SofaScoreTask extends Model
|
||||
'is_active',
|
||||
'compleated',
|
||||
'run_repeatedly',
|
||||
'run_slow',
|
||||
'last_start',
|
||||
'last_end',
|
||||
];
|
||||
|
||||
+22
-34
@@ -1,8 +1,19 @@
|
||||
case "$1" in
|
||||
"1")
|
||||
''|*[!0-9]*)
|
||||
echo ""
|
||||
echo "--------------------------"
|
||||
echo "GRAPPER SOFASCORE"
|
||||
echo "--------------------------"
|
||||
echo "taks one parameter"
|
||||
echo "use id sofa_score_tasks table"
|
||||
echo "--------------------------"
|
||||
echo ""
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
# AUTO GRAPPER SOFASCORE (debug)
|
||||
|
||||
echo "\n⚽ process function $1 sofa_score_task $2"
|
||||
echo "\n⚽ sofa_score_task $1"
|
||||
|
||||
echo "\n⚽ close all vpn"
|
||||
killall ssh
|
||||
@@ -11,54 +22,31 @@ case "$1" in
|
||||
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
|
||||
php artisan nuh --d --f 67 --fun=2 --task=$1
|
||||
|
||||
echo "\n⚽ close vpn"
|
||||
killall ssh
|
||||
|
||||
echo "\n⚽ start task"
|
||||
php artisan nuh --d --f 67 --fun=7 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=7 --task=$1
|
||||
|
||||
echo "\n⚽ get tournaments for the day"
|
||||
php artisan nuh --d --f 67 --fun=5 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=5 --task=$1
|
||||
|
||||
echo "\n⚽ grapper events for the day"
|
||||
php artisan nuh --d --f 67 --fun=6 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=6 --task=$1
|
||||
|
||||
echo "\n⚽ create zip archive"
|
||||
php artisan nuh --d --f 67 --fun=3 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=3 --task=$1
|
||||
|
||||
echo "\n⚽ mail archive"
|
||||
php artisan nuh --d --f 67 --fun=4 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=4 --task=$1
|
||||
|
||||
echo "\n⚽ end task"
|
||||
php artisan nuh --d --f 67 --fun=8 --task=$2
|
||||
php artisan nuh --d --f 67 --fun=8 --task=$1
|
||||
|
||||
echo "\n😎 done :)"
|
||||
;;
|
||||
"2")
|
||||
# AUTO GRAPPER SOFASCORE (production no debug and 10s breaks)
|
||||
echo "\n⚽ process function $1 sofa_score_task $2"
|
||||
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=$2
|
||||
killall ssh
|
||||
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 "\n😎 done :)"
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "--------------------------"
|
||||
echo "apple damon grapper sofascore"
|
||||
echo "--------------------------"
|
||||
echo "1 => debug max 5sec intervals"
|
||||
echo "2 => prod max 10sec intervals"
|
||||
echo "--------------------------"
|
||||
echo ""
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
"laravel/framework": "*",
|
||||
"laravel/tinker": "*",
|
||||
"mongodb/laravel-mongodb": "^5.1",
|
||||
"mongodb/mongodb": "^2.0",
|
||||
"mongodb/mongodb": "^2.3",
|
||||
"outhebox/blade-flags": "*",
|
||||
"spatie/simple-excel": "^3.9",
|
||||
"stevebauman/location": "*",
|
||||
|
||||
@@ -21,7 +21,6 @@ return new class extends Migration
|
||||
$table->boolean('is_active')->default(0);
|
||||
$table->boolean('compleated')->default(0);
|
||||
$table->boolean('run_repeatedly')->default(0);
|
||||
$table->boolean('run_slow')->default(0);
|
||||
$table->dateTime('last_start')->nullable();
|
||||
$table->dateTime('last_end')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
Reference in new issue
Block a user