'exch' => $c,
'expr' => 'USD',
'margin_fixed' => 0,
- 'format'=> 'CSV'
+ 'format'=> 'HTML'
);
- }
-
- $response = $this->curl($this->actionUrl, $params, 'POST');
-
- libxml_use_internal_errors (true);
-
- $doc = new DOMDocument();
- $doc->loadHTML($response);
+
+ $response = $this->curl($this->actionUrl, $params, 'POST');
- libxml_use_internal_errors (false);
-
- $xpath = new DOMXpath($doc);
-
- $ts = $xpath->query("//td[@id='content_section']");
+ 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;
+
+ $curr = DB_DataObject::factory('core_curr_rate');
+
+ $curr->setFrom(array(
+
+ ));
+
+ }
- $elements = $xpath->query("table/tr/td/pre", $ts->item(0));
- print_r($elements->item(0));
}