wip
This commit is contained in:
1 parent
fa0e2cdef1
commit
4f9125ef12
13 files changed
+100
-64
No files matched your search
@@ -20,7 +20,7 @@ class Bet365
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
$today = Nuh::$options['t'] ?? 0;
|
||||
|
||||
$week = Nuh::$options['w'] ?? 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ class Bet365
|
||||
*/
|
||||
$bookmaker_id = 126;
|
||||
|
||||
if ($break) {
|
||||
if ($today) {
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDay()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} elseif ($week) {
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
|
||||
@@ -23,7 +23,7 @@ class Fixtures
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
$today = Nuh::$options['t'] ?? 0;
|
||||
|
||||
/**
|
||||
* Delete Started
|
||||
@@ -108,7 +108,7 @@ class Fixtures
|
||||
}
|
||||
}
|
||||
|
||||
if ($break) {
|
||||
if ($today) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Console\Commands\Grapper\Logifuture\Auth;
|
||||
|
||||
class BaseUrl
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
$test = Nuh::$options['t'] ?? 0;
|
||||
|
||||
$test = false;
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 5:
|
||||
if ($test) {
|
||||
|
||||
@@ -9,7 +9,7 @@ class BaseUrl
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
$test = Nuh::$options['t'] ?? 0;
|
||||
$test = 0;
|
||||
|
||||
switch (Nuh::$options['provider_id']) {
|
||||
case 3:
|
||||
|
||||
@@ -17,7 +17,7 @@ class Fixtures
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$echo = Nuh::$options['e'] ?? 0;
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
$break = Nuh::$options['t'] ?? 0;
|
||||
$week = Nuh::$options['w'] ?? 0;
|
||||
|
||||
$count = 0;
|
||||
@@ -38,7 +38,7 @@ class Fixtures
|
||||
/**
|
||||
* Grap
|
||||
*/
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
for ($i = Nuh::$options['days_from']; $i < Nuh::$options['days_to']; $i++) {
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/result/xml.php?'.Nuh::$AUTHTOKEN.'&date='.$now->toDateString().','.$now->addDays(1)->toDateString();
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@ class Odds
|
||||
*************************************************/
|
||||
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
$echo = Nuh::$options['e'] ?? 0;
|
||||
|
||||
switch (Nuh::$options['sport_id']) {
|
||||
case 1:
|
||||
@@ -118,38 +117,74 @@ class Odds
|
||||
*************************************************/
|
||||
$url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&spid='.Nuh::$options['sport_id'];
|
||||
$_calls = [];
|
||||
if (Nuh::$options['event_id']) {
|
||||
// by id
|
||||
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['event_id'];
|
||||
if (Nuh::$options['id']) {
|
||||
if ($debug) {
|
||||
Notice::note('BY ID', 'p');
|
||||
}
|
||||
/**
|
||||
* BY ID
|
||||
*/
|
||||
$_calls[] = $url."&ot=$markets&peid=".Nuh::$options['id'];
|
||||
} elseif (Nuh::$options['a']) {
|
||||
// all existing
|
||||
if ($debug) {
|
||||
Notice::note('ALL EXISTING', 'p');
|
||||
}
|
||||
/**
|
||||
* ALL EXISTING
|
||||
*/
|
||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id');
|
||||
foreach ($res as $id) {
|
||||
$_calls[] = $url."&ot=$markets&peid=".$id;
|
||||
}
|
||||
} elseif (Nuh::$options['g']) {
|
||||
// one week per group names (mybee fastes)
|
||||
if ($debug) {
|
||||
Notice::note('PER GROUP_ID', 'p');
|
||||
}
|
||||
/**
|
||||
* PER GROUP_ID
|
||||
*
|
||||
* with from-to days
|
||||
*/
|
||||
$groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id');
|
||||
foreach ($groupids as $groupid) {
|
||||
$_calls[] = $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&ot='.$markets.'&days=0,1&pgid='.$groupid;
|
||||
$_calls[] = $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&ot='.$markets.'&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&pgid='.$groupid;
|
||||
}
|
||||
} elseif (Nuh::$options['b']) {
|
||||
// one day
|
||||
} elseif (Nuh::$options['t']) {
|
||||
if ($debug) {
|
||||
Notice::note('TODAY', 'p');
|
||||
}
|
||||
/**
|
||||
* TODAY
|
||||
*/
|
||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->pluck('id');
|
||||
foreach ($res as $id) {
|
||||
$_calls[] = $url."&ot=$markets&peid=".$id;
|
||||
}
|
||||
} elseif (Nuh::$options['w']) {
|
||||
// one week
|
||||
if ($debug) {
|
||||
Notice::note('ONE WEEK FROM NOW', 'p');
|
||||
}
|
||||
/**
|
||||
* ONE WEEK
|
||||
*/
|
||||
$res = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('id');
|
||||
foreach ($res as $id) {
|
||||
$_calls[] = $url."&ot=$markets&peid=".$id;
|
||||
}
|
||||
} else {
|
||||
// all with lastcall
|
||||
$_calls[] = $url."&ot=$markets&last=".Nuh::$options['lastcall'];
|
||||
if ($debug) {
|
||||
Notice::note('WITH LASTCALL Parameter', 'p');
|
||||
}
|
||||
/**
|
||||
* WITH LASTCALL Parameter
|
||||
|
||||
* with from-to days
|
||||
*/
|
||||
$_calls[] = $url."&ot=$markets&days=".Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&last='.Nuh::$options['lastcall'];
|
||||
}
|
||||
|
||||
dd($_calls);
|
||||
|
||||
/*************************************************
|
||||
* CALL
|
||||
*************************************************/
|
||||
@@ -160,10 +195,6 @@ class Odds
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
if ($echo) {
|
||||
dd($data);
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note('counter: '.count($_calls).'/'.$counter, 'g');
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class Nuh extends Command
|
||||
|
||||
public static $BETSAPI_TOKEN = '36152-aeTRNnZxSPUwGe';
|
||||
|
||||
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--w} {--p} {--e} {--s} {--r} {--b} {--q} {--t} {--g}';
|
||||
protected $signature = 'nuh {process=help} {--id=0} {--f=} {--a} {--p} {--d} {--b} {--w} {--g} {--r} {--s} {--t}';
|
||||
|
||||
protected $description = 'Nuh';
|
||||
|
||||
@@ -32,7 +32,6 @@ class Nuh extends Command
|
||||
{
|
||||
self::$options = $this->options();
|
||||
self::$options['supervisor_id'] = $this->argument('process');
|
||||
self::$options['event_id'] = $this->argument('eventid');
|
||||
|
||||
$queries = self::$options['q'] ?? 0;
|
||||
|
||||
@@ -41,23 +40,21 @@ class Nuh extends Command
|
||||
$txt .= 'List of parameters'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= 'process [id] (required)'.PHP_EOL;
|
||||
$txt .= 'eventid [id] (optional)'.PHP_EOL;
|
||||
$txt .= '--id=matchid (optional) calling spezific id'.PHP_EOL;
|
||||
$txt .= '--func=name (optional) start special function in code'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL.PHP_EOL;
|
||||
$txt .= 'List of options'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= '--a reload all'.PHP_EOL;
|
||||
$txt .= '--p use proxy'.PHP_EOL;
|
||||
$txt .= '--d debug'.PHP_EOL;
|
||||
|
||||
$txt .= '--b load one day single '.PHP_EOL;
|
||||
$txt .= '--w laod one week (tx)'.PHP_EOL;
|
||||
$txt .= '--g by minor groups (tx)'.PHP_EOL;
|
||||
|
||||
$txt .= '--d debug'.PHP_EOL;
|
||||
$txt .= '--e echo file'.PHP_EOL;
|
||||
$txt .= '--f force update market'.PHP_EOL;
|
||||
|
||||
$txt .= '--p use proxy'.PHP_EOL;
|
||||
$txt .= '--q print queries'.PHP_EOL;
|
||||
$txt .= '--r read data from file '.PHP_EOL;
|
||||
|
||||
$txt .= '--s store data to file '.PHP_EOL;
|
||||
$txt .= '--t test server url '.PHP_EOL;
|
||||
|
||||
|
||||
Reference in new issue
Block a user