34 lines
962 B
PHP
34 lines
962 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper\TxOdds;
|
|
|
|
use App\Console\Commands\Grapper\Grapper;
|
|
use App\Models\Country;
|
|
use App\Utilities\Notice;
|
|
|
|
class Countries
|
|
{
|
|
public static function grap()
|
|
{
|
|
Notice::note('disabled as txodds data is a mess, had to fix all manually', 'r', 1);
|
|
|
|
$response = simplexml_load_file(Grapper::$domain.'feed/countries.php', null, LIBXML_NOCDATA);
|
|
|
|
foreach ($response->country as $country) {
|
|
$res = Country::where('txid', $country->id)->first();
|
|
if ($res !== null) {
|
|
// $res->txid = $country->id;
|
|
// $res->txid = $country->id;
|
|
// $res->save();
|
|
} else {
|
|
$res = new Country;
|
|
$res->name = $country->name;
|
|
$res->iso3 = $country->cc;
|
|
$res->txid = $country->id;
|
|
$res->tx_only = 1;
|
|
$res->save();
|
|
}
|
|
}
|
|
}
|
|
}
|