wip
This commit is contained in:
1 parent
d16a8a3a1f
commit
ba6c2263e3
10 files changed
+229
-49
No files matched your search
@@ -8,11 +8,12 @@ class Curl
|
|||||||
{
|
{
|
||||||
public static $file;
|
public static $file;
|
||||||
|
|
||||||
public static function load($url, $proxy = false)
|
public static function load($url)
|
||||||
{
|
{
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
$save = Nuh::$options['s'] ?? 0;
|
$save = Nuh::$options['s'] ?? 0;
|
||||||
$read = Nuh::$options['r'] ?? 0;
|
$read = Nuh::$options['r'] ?? 0;
|
||||||
|
$proxy = Nuh::$options['p'] ?? 0;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($url);
|
Notice::note($url);
|
||||||
@@ -30,32 +31,36 @@ class Curl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($proxy) {
|
if ($proxy) {
|
||||||
$request = curl_init('https://proxydb1.nuhodds.com');
|
$ch = curl_init();
|
||||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_URL, Nuh::$options['proxy']);
|
||||||
curl_setopt($request, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
curl_setopt($request, CURLOPT_HTTPHEADER, [
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
'Proxy-Auth: iKduDrM9HJA6T6t5e5xnkQ9KUNWLvTXhRwdUEN2Twfwlr4jzu',
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
'Proxy-Target-URL: '.$url,
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, ['url' => $url]);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
|
'Proxy-Auth: AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return curl_exec($request);
|
|
||||||
} else {
|
} else {
|
||||||
$request = curl_init($url);
|
$ch = curl_init($url);
|
||||||
curl_setopt($request, CURLOPT_TIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 30);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
curl_setopt($request, CURLOPT_FAILONERROR, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_FAILONERROR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = curl_exec($request);
|
$data = curl_exec($ch);
|
||||||
|
|
||||||
$curl_errorno = curl_errno($request);
|
$curl_errorno = curl_errno($ch);
|
||||||
if ($curl_errorno) {
|
if ($curl_errorno) {
|
||||||
Notice::note('curl_errorno: '.self::curlerrorcode($curl_errorno));
|
Notice::note('curl_errorno: '.self::curlerrorcode($curl_errorno));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 80000) {
|
if (PHP_VERSION_ID < 80000) {
|
||||||
curl_close($request);
|
curl_close($ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($save) {
|
if ($save) {
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ class Magloo
|
|||||||
{
|
{
|
||||||
public static function switch()
|
public static function switch()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Nuh::$options['proxy'] = 'https://proxydb1.nuhodds.com/MaglooProxy.php';
|
||||||
|
|
||||||
switch (Nuh::$options['name']) {
|
switch (Nuh::$options['name']) {
|
||||||
case 'Fixtures':
|
case 'Fixtures':
|
||||||
Fixtures::grap();
|
Fixtures::grap();
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper\Magloo;
|
|||||||
use App\Console\Commands\Curl;
|
use App\Console\Commands\Curl;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Sport;
|
use App\Models\Sport;
|
||||||
use App\Utilities\Notice;
|
|
||||||
|
|
||||||
class Fixtures
|
class Fixtures
|
||||||
{
|
{
|
||||||
@@ -15,35 +14,12 @@ class Fixtures
|
|||||||
$test = Nuh::$options['t'] ?? 0;
|
$test = Nuh::$options['t'] ?? 0;
|
||||||
$echo = Nuh::$options['e'] ?? 0;
|
$echo = Nuh::$options['e'] ?? 0;
|
||||||
|
|
||||||
switch (Nuh::$options['provider_id']) {
|
|
||||||
case 3:
|
|
||||||
// KENIA
|
|
||||||
if ($test) {
|
|
||||||
$url = 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch';
|
|
||||||
} else {
|
|
||||||
$url = 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
// NIGERIA
|
|
||||||
if ($test) {
|
|
||||||
$base_url = 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch';
|
|
||||||
} else {
|
|
||||||
$url = 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Notice::note('prosses name does not exist', 'r', 1);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$sportmap = Sport::map('magl');
|
$sportmap = Sport::map('magl');
|
||||||
|
|
||||||
$url = $base_url.'/sport';
|
$url = Url::sports();
|
||||||
$url = 'https://www.github.com';
|
|
||||||
$_data = Curl::load($url, 1);
|
|
||||||
|
|
||||||
dd($_data);
|
$file = Curl::load($url);
|
||||||
|
|
||||||
|
dd($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands\Grapper\Magloo;
|
||||||
|
|
||||||
|
use App\Console\Commands\Nuh;
|
||||||
|
use App\Utilities\Notice;
|
||||||
|
|
||||||
|
class Url
|
||||||
|
{
|
||||||
|
public static function sports()
|
||||||
|
{
|
||||||
|
$test = Nuh::$options['t'] ?? 0;
|
||||||
|
|
||||||
|
switch (Nuh::$options['provider_id']) {
|
||||||
|
case 3:
|
||||||
|
// KENIA
|
||||||
|
if ($test) {
|
||||||
|
return 'https://int.external.api.algorez.com/api/sb/affiliates/30/en/1/prematch/sport';
|
||||||
|
} else {
|
||||||
|
return 'https://api.externalsvc.com/api/sb/affiliates/30/en/1/prematch/sport';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// NIGERIA
|
||||||
|
if ($test) {
|
||||||
|
return 'https://int.external.api.algorez.com/api/sb/affiliates/20/en/1/prematch/sport';
|
||||||
|
} else {
|
||||||
|
return 'https://api.externalsvc.com/api/sb/affiliates/20/en/1/prematch/sport';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Notice::note('process name does not exist', 'r', 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,8 @@ namespace App\Filament\Resources\Events\Tables;
|
|||||||
use App\Filament\Tables\Columns\MultilineColumn;
|
use App\Filament\Tables\Columns\MultilineColumn;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Filament\Actions\Action;
|
||||||
|
use Filament\Actions\ActionGroup;
|
||||||
use Filament\Actions\DeleteAction;
|
use Filament\Actions\DeleteAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
use Filament\Support\Enums\FontWeight;
|
use Filament\Support\Enums\FontWeight;
|
||||||
@@ -75,8 +77,18 @@ class EventsTable
|
|||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->persistFiltersInSession()
|
->persistFiltersInSession()
|
||||||
->recordActions([
|
->recordActions([
|
||||||
// EditAction::make(),
|
ActionGroup::make([
|
||||||
// DeleteAction::make()->iconButton(),
|
// EditAction::make(),
|
||||||
|
// DeleteAction::make(),
|
||||||
|
Action::make('txodds_odds')
|
||||||
|
->label('TxOdds')
|
||||||
|
->disabled(fn () => ! auth()->user()->super_admin)
|
||||||
|
->icon('heroicon-o-arrow-top-right-on-square')
|
||||||
|
->url(fn ($record): string => route('txodds_odds', ['sportid' => $record->sport_id, 'txoddsid' => $record->tx_id]))
|
||||||
|
->openUrlInNewTab(),
|
||||||
|
])->iconButton()
|
||||||
|
->icon('heroicon-m-ellipsis-vertical')
|
||||||
|
->color('primary'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use App\Console\Commands\Curl;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class OpenExternalPage extends Component
|
||||||
|
{
|
||||||
|
public function txodds_odds($sportid, $txoddsid)
|
||||||
|
{
|
||||||
|
if ($sportid == 1) {
|
||||||
|
$code = config('env.txodds_betaid1');
|
||||||
|
} else {
|
||||||
|
$code = config('env.txodds_betaid2');
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = "https://xml2.txodds.com/feed/odds/xml.php?$code&ot=0,4&peid=$txoddsid";
|
||||||
|
|
||||||
|
$request = curl_init($url);
|
||||||
|
curl_setopt($request, CURLOPT_TIMEOUT, 30);
|
||||||
|
curl_setopt($request, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
|
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($request, CURLOPT_FAILONERROR, true);
|
||||||
|
|
||||||
|
$data = curl_exec($request);
|
||||||
|
header('Content-type: text/xml');
|
||||||
|
echo $data;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public function betsapi_odds($eventid)
|
||||||
|
// {
|
||||||
|
// $code = config('env.betsapi_token');
|
||||||
|
// $url = "https://api.b365api.com/v2/event/odds?token=$code&source=bet365&event_id=$eventid";
|
||||||
|
// $data = Curl::load($url);
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($data);
|
||||||
|
// echo '</pre>';
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function betsapi_results($bet365_id)
|
||||||
|
// {
|
||||||
|
// $code = config('env.betsapi_token');
|
||||||
|
// $url = "https://api.b365api.com/v1/bet365/result?token=$code&event_id=$bet365_id";
|
||||||
|
// $data = Curl::load($url);
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($data);
|
||||||
|
// echo '</pre>';
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function betsapi_raw($bet365_id)
|
||||||
|
// {
|
||||||
|
// $code = config('env.betsapi_token');
|
||||||
|
// $url = "https://api.b365api.com/v1/bet365/event?token=$code&FI=$bet365_id";
|
||||||
|
// $data = Curl::load($url);
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($data);
|
||||||
|
// echo '</pre>';
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function betsapi_lineup($eventid)
|
||||||
|
// {
|
||||||
|
// $code = config('env.betsapi_token');
|
||||||
|
// $url = "https://api.b365api.com/v1/event/lineup?token=$code&event_id=$eventid";
|
||||||
|
// $data = Curl::load($url);
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($data);
|
||||||
|
// echo '</pre>';
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* prod call env wars only in config folder, it will be cached
|
||||||
|
*/
|
||||||
|
return [
|
||||||
|
'app_env' => env('APP_ENV', 'production'),
|
||||||
|
'betsapi_token' => env('BETSAPI_TOKEN', '36152-aeTRNnZxSPUwGe'),
|
||||||
|
'txodds_betaid1' => env('TXODDS_TOKEN_SOCCER', 'ident=betaid1&passwd=Dy59vpRC'),
|
||||||
|
'txodds_betaid2' => env('TXODDS_TOKEN_OTHER', 'ident=betaid1&passwd=Dy59vpRC'),
|
||||||
|
];
|
||||||
+19
-2
@@ -1,7 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// use Illuminate\Support\Facades\Route;
|
use App\Livewire\OpenExternalPage;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
// Route::get('/', function () {
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Web Routes
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here is where you can register web routes for your application. These
|
||||||
|
| routes are loaded by the RouteServiceProvider and all of them will
|
||||||
|
| be assigned to the "web" middleware group. Make something great!
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Route::get('/login', function () {
|
||||||
// return view('welcome');
|
// return view('welcome');
|
||||||
// });
|
// });
|
||||||
|
Route::controller(OpenExternalPage::class)->group(function () {
|
||||||
|
Route::get('/txodds_odds/{sportid}/{txoddsid}', 'txodds_odds')->name('txodds_odds');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Route::middleware('auth:sanctum')->group(function () {});
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($_SERVER['HTTP_PROXY_AUTH'] != 'AIkcoRnipSgMK88WMQhOQQN3LKDrNDCIebNfPnEayJdmDeTigx') {
|
||||||
|
echo 'not authorized';
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $_POST['url']);
|
||||||
|
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
|
$file = curl_exec($ch);
|
||||||
|
|
||||||
|
if (curl_errno($ch)) {
|
||||||
|
echo curl_error($ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>NuhOdds Proxy</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
color: #e7e5e4;
|
||||||
|
background-color: #0c0a09;
|
||||||
|
text-align: center;
|
||||||
|
margin: 2rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h1>NuhOdds Proxy Server</h1>
|
||||||
|
<p>
|
||||||
|
You are not authorized!
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in new issue
Block a user