- $rate = str_getcsv($elements->item(0)->nodeValue, ",", "\"");
+ libxml_use_internal_errors (true);
+
+ $doc = new DOMDocument();
+ $doc->loadHTML($response);
+
+ libxml_use_internal_errors (false);
+
+ $xpath = new DOMXpath($doc);
+
+ $elements = $xpath->query("//td[@id='content_section']/table/tr[last()]/td/table/tr[1]/td[last()]");
+
+ $rate = empty($elements->item(0)->nodeValue) ? 0 : $elements->item(0)->nodeValue * 1;
+
+ $this->processCurrRate($c, $rate, $fromDate, $toDate);
+
+ if(array_key_exists($c, $this->mapping)){
+ $this->processCurrRate($this->mapping[$c], $rate, $fromDate, $toDate);
+ }
+ }