wip countries
This commit is contained in:
1 parent
641b362752
commit
1b9a65b25a
23 files changed
+127755
-27137
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Curl;
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Country;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Countries
|
||||
{
|
||||
public static function call()
|
||||
{
|
||||
$debug = NuhBash::$options['d'] ?? 0;
|
||||
$print = NuhBash::$options['p'] ?? 0;
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/countries.php';
|
||||
|
||||
$data = Curl::load($url, $debug);
|
||||
|
||||
if ($print) {
|
||||
Notice::note($data, '', 1);
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
foreach ($data as $row) {
|
||||
Country::updateOrCreate(
|
||||
['txid' => (int) $row->id],
|
||||
['name' => (string) $row->name, 'cc' => (string) $row->cc]
|
||||
);
|
||||
$count++;
|
||||
}
|
||||
Notice::note("$count countries processed", 'g');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user