Skip to content

Instantly share code, notes, and snippets.

@azhurb
Created April 25, 2014 12:35
Show Gist options
  • Select an option

  • Save azhurb/11288140 to your computer and use it in GitHub Desktop.

Select an option

Save azhurb/11288140 to your computer and use it in GitHub Desktop.
Fix NBU course update (issue #4053)
Index: server/lib/course.class.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- server/lib/course.class.php (date 1397743696000)
+++ server/lib/course.class.php (revision )
@@ -10,7 +10,7 @@
{
public $db;
public $cache_table;
- public $content_url = 'http://www.bank.gov.ua/control/uk/curmetal/detail/currency?period=daily';
+ public $content_url = 'http://www.bank.gov.ua/control/en/curmetal/detail/currency?period=daily';
public $codes = array(840, 978, 643);
public function __construct(){
@@ -26,7 +26,7 @@
$result = array();
$content = file_get_contents($this->content_url);
if ($content){
- preg_match("/<td class=\"date\">([\d,\.]+)<\/td>/",$content,$arr);
+ preg_match("/([\d]{2}\.[\d]{2}\.[\d]{4})<\/b>/",$content,$arr);
$result['title'] = _('Exchange rate on').' '.$arr[1];
$result['on_date'] = $arr[1];
$result['data'] = array();
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment