popup and grapper wip
This commit is contained in:
1 parent
a3c9f16550
commit
c9588f39b6
18 files changed
+656
-156248
No files matched your search
@@ -21,26 +21,25 @@ class Fixtures
|
||||
|
||||
$count = 0;
|
||||
$total = 0;
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*/
|
||||
// $info = 0;
|
||||
$info = Event::where('starttime', '<', $now->toDateTimeString())->delete();
|
||||
$info = Event::where('starttime', '<', Carbon::now()->toDateTimeString())->delete();
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("Deleted: $info");
|
||||
}
|
||||
|
||||
/**
|
||||
* Grap
|
||||
*/
|
||||
for ($i = 0; $i < 30; $i++) {
|
||||
|
||||
$from = $now->addDays($i)->toDateString();
|
||||
$to = $now->addDays($i + 1)->toDateString();
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/result/xml.php?'.Nuh::$AUTHTOKEN."&date=$from,$to";
|
||||
$url = 'https://xml2.txodds.com/feed/result/xml.php?'.Nuh::$AUTHTOKEN.'&date='.$now->toDateString().','.$now->addDays(1)->toDateString();
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
@@ -94,12 +93,12 @@ class Fixtures
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
Notice::note("$from - $count events processed", 'g');
|
||||
Notice::note($now->toDateString()." - $count events processed", 'g');
|
||||
}
|
||||
|
||||
$total += $count;
|
||||
|
||||
if ($break || $debug) {
|
||||
if ($break) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user