Aleksandar Lazic's patch to handle GetFileFromURL returning nothing
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1767 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -121,7 +121,7 @@ sub Weather_RetrieveDataDirectly($)
|
|||||||
|
|
||||||
my $fc = undef;
|
my $fc = undef;
|
||||||
my $xml = GetFileFromURL("http://www.google.com/ig/api?weather=" . $location . "&hl=" . $lang);
|
my $xml = GetFileFromURL("http://www.google.com/ig/api?weather=" . $location . "&hl=" . $lang);
|
||||||
return 0 if($xml eq "");
|
return 0 if( ! defined $xml || $xml eq "");
|
||||||
foreach my $l (split("<",$xml)) {
|
foreach my $l (split("<",$xml)) {
|
||||||
#Log 1, "DEBUG WEATHER: line=\"$l\"";
|
#Log 1, "DEBUG WEATHER: line=\"$l\"";
|
||||||
next if($l eq ""); # skip empty lines
|
next if($l eq ""); # skip empty lines
|
||||||
|
|||||||
Reference in New Issue
Block a user