wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Console\Commands\Xml;
|
||||
use App\Models\Country;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Countries
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/countries.php';
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
$count = 0;
|
||||
foreach ($data as $row) {
|
||||
Country::updateOrCreate(
|
||||
['id' => (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