From 7afe9c2ecb5a00b869b3e99eeb89c8197ea65ad4 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 29 Dec 2013 17:55:47 -0500 Subject: [PATCH] Improve finding of proper update time. --- conky-mythtv-weather-build.plx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conky-mythtv-weather-build.plx b/conky-mythtv-weather-build.plx index 5acb15a..6421f88 100755 --- a/conky-mythtv-weather-build.plx +++ b/conky-mythtv-weather-build.plx @@ -102,10 +102,12 @@ if (not defined $data{extended}{updatetime}) { } } -$data{forecast}{updatetime} =~ s/\s*Last\s+Updated\s+(?:on|:)?\s*// - if defined $data{forecast}{updatetime}; +my $updateTime = $data{forecast}{updatetime}; +$updateTime = $data{extended}{updatetime} if not defined $updateTime; + +$updateTime =~ s/\s*(?:Last\s*)?Updated\s*(?:on|:)?\s*//; my $now = ParseDate("now"); -my $updateTime = ParseDate($data{forecast}{updatetime}); +$updateTime = ParseDate($updateTime); my $x = Delta_Format(DateCalc($updateTime, $now), 0, "%mt minutes ago"); $data{forecast}{updatetime} = $x if defined $x;