summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Ripley <vitaminjoe@gmail.com>2011-03-11 04:38:13 (GMT)
committer Gavin Hurlbut <ghurlbut@mythtv.org>2011-03-11 04:41:41 (GMT)
commit40fc4546aee84c8efd2c1e0af837c934cb376512 (patch)
treeed758cfa1fdef1f047d163e3b43076c0d7454a40
parent13be9c27f99478bf86336fae5b9e78bbb8d52d04 (diff)
Change ENVCAN parser to use &deg; rather than \260
Fixes #9657 Seems Environment Canada changed their data format for reporting temperatures. Signed-off-by: Gavin Hurlbut <ghurlbut@mythtv.org> (cherry picked from commit c68c7aed28d2c4e382bc1f36a6cf66d59ca4a2e7)
-rw-r--r--mythplugins/mythweather/mythweather/scripts/ca_envcan/ENVCANParser.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/mythplugins/mythweather/mythweather/scripts/ca_envcan/ENVCANParser.pm b/mythplugins/mythweather/mythweather/scripts/ca_envcan/ENVCANParser.pm
index 0d0e3d6..7420a66 100644
--- a/mythplugins/mythweather/mythweather/scripts/ca_envcan/ENVCANParser.pm
+++ b/mythplugins/mythweather/mythweather/scripts/ca_envcan/ENVCANParser.pm
@@ -11,7 +11,7 @@ use strict;
use POSIX;
use XML::Simple;
-our $VERSION = 0.4;
+our $VERSION = 0.5;
my %results;
my %directions = ( N => "North", NNE => "North Northeast",
@@ -93,7 +93,7 @@ sub doParse {
$results{'weather_icon'} = getIcon($1);
}
$results{'temp'} = sprintf("%.0f", $1)
- if ($item->{description} =~ /Temperature:\<\/b\>\s*(-?\d*\.?\d*)\260\C\s*\<br\/\>/s);
+ if ($item->{description} =~ /Temperature:\<\/b\>\s*(-?\d*\.?\d*)\&deg\;\C\s*\<br\/\>/s);
$results{'pressure'} = sprintf("%d", $1 * 10)
if ($item->{description} =~ /Pressure \/ Tendency:\<\/b\>\s*(\d*\.?\d*) kPa\s*.*\<br\/\>/s);
$results{'visibility'} = sprintf("%.1f", $1)
@@ -105,7 +105,7 @@ sub doParse {
$results{'windchill'} = $1;
}
$results{'dewpoint'} = sprintf("%.0f", $1)
- if ($item->{description} =~ /Dewpoint:\<\/b\>\s*(-?\d*\.?\d*)\260\C\s*\<br\/\>/s);
+ if ($item->{description} =~ /Dewpoint:\<\/b\>\s*(-?\d*\.?\d*)\&deg\;\C\s*\<br\/\>/s);
if ($item->{description} =~ /(\d*\:\d*[\w ]*\d*[\w *]\d*)\s*\<br\/\>/s) {
$results{'observation_time'} = "Last updated at ". $1;
$results{'updatetime'} = "Last updated at ". $1;