|
@@ -18,7 +18,7 @@ class Parser extends CI_Controller
|
18
|
18
|
$this->load->helper('file');
|
19
|
19
|
$this->load->helper('xml');
|
20
|
20
|
$this->load->library('parserfile');
|
21
|
|
-
|
|
21
|
+
|
22
|
22
|
$this->load->model("Parser_model");
|
23
|
23
|
}
|
24
|
24
|
|
|
@@ -62,38 +62,38 @@ class Parser extends CI_Controller
|
62
|
62
|
private function downloadProcess($urlXML)
|
63
|
63
|
{
|
64
|
64
|
$fileName = basename($urlXML);
|
65
|
|
- $downladedZip = $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
|
66
|
|
-
|
67
|
|
- if ($downladedZip) {
|
68
|
|
- $zip = new ZipArchive;
|
69
|
|
- if ($zip->open($this->rutaDiariaFecha . $fileName)) {
|
70
|
|
- $zip->extractTo($this->rutaDiariaFecha);
|
71
|
|
- $zip->close();
|
72
|
|
- unlink($this->rutaDiariaFecha . $fileName);
|
73
|
|
- $archivosTotales = get_filenames($this->rutaDiariaFecha);
|
74
|
|
-
|
75
|
|
- foreach ($archivosTotales as $file) {
|
76
|
|
- $this->getFile($this->rutaDiariaFecha . $file, $file);
|
77
|
|
- }
|
78
|
|
-
|
79
|
|
- }
|
|
65
|
+ //$downladedZip = $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
|
|
66
|
+
|
|
67
|
+ /* if ($downladedZip) {
|
|
68
|
+ $zip = new ZipArchive;
|
|
69
|
+ if ($zip->open($this->rutaDiariaFecha . $fileName)) {
|
|
70
|
+ $zip->extractTo($this->rutaDiariaFecha);
|
|
71
|
+ $zip->close();
|
|
72
|
+ unlink($this->rutaDiariaFecha . $fileName);
|
|
73
|
+ $archivosTotales = get_filenames($this->rutaDiariaFecha);
|
|
74
|
+
|
|
75
|
+ foreach ($archivosTotales as $file) {
|
|
76
|
+ $this->getFile($this->rutaDiariaFecha . $file, $file);
|
|
77
|
+ }
|
80
|
78
|
|
81
|
79
|
}
|
82
|
80
|
|
83
|
|
- /*$archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
|
84
|
|
- $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
|
|
81
|
+ } */
|
|
82
|
+ $this->downloadFile($fileName, $urlXML, $this->rutaDiariaFecha);
|
|
83
|
+ $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
|
|
84
|
+ $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
|
85
|
85
|
|
86
|
|
- while ($nuevoAtomAttrNext !== "") {
|
87
|
|
- //$aux = 0;
|
88
|
|
- //while ($aux <= 3) {
|
|
86
|
+ while ($nuevoAtomAttrNext !== "") {
|
|
87
|
+ //$aux = 0;
|
|
88
|
+ //while ($aux <= 3) {
|
89
|
89
|
|
90
|
|
- $fileName = basename($nuevoAtomAttrNext);
|
91
|
|
- $this->downloadFile($fileName, $nuevoAtomAttrNext, $this->rutaDiariaFecha);
|
92
|
|
- $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
|
|
90
|
+ $fileName = basename($nuevoAtomAttrNext);
|
|
91
|
+ $this->downloadFile($fileName, $nuevoAtomAttrNext, $this->rutaDiariaFecha);
|
|
92
|
+ $archivoAtom = $this->getFile($this->rutaDiariaFecha . $fileName, $fileName);
|
93
|
93
|
|
94
|
|
- $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
|
95
|
|
- //$aux++;
|
96
|
|
- }*/
|
|
94
|
+ $nuevoAtomAttrNext = $this->readNextAttribute($archivoAtom);
|
|
95
|
+ //$aux++;
|
|
96
|
+ }
|
97
|
97
|
}
|
98
|
98
|
|
99
|
99
|
private function getFile($url, $fileName)
|
|
@@ -134,7 +134,12 @@ class Parser extends CI_Controller
|
134
|
134
|
$attrHref = $row['@attributes']['href'];
|
135
|
135
|
|
136
|
136
|
if ($attrNext === "next") {
|
137
|
|
- $enlace = $attrHref;
|
|
137
|
+ if (!strpos($attrHref, "20220127_")) {
|
|
138
|
+ $enlace = $attrHref;
|
|
139
|
+ } else {
|
|
140
|
+ $enlace = "";
|
|
141
|
+ }
|
|
142
|
+
|
138
|
143
|
}
|
139
|
144
|
}
|
140
|
145
|
|