Made corrections location output

This commit is contained in:
bluesaxman 2020-07-21 10:41:16 -06:00
parent f98faab11f
commit 26e671051b
2 changed files with 5 additions and 4 deletions

View File

@ -89,6 +89,7 @@ elsif ($type =~ /Overcast/) {$type = "";}
elsif ($type =~ /cloud/) {$type = "";}
elsif ($type =~ /Clear/) {$type = "";}
elsif ($type =~ /Sun/) {$type = "";}
elsif ($type eq "NA") {$type = "";}
elsif ($type =~ /Snow/) {$type = "";}
else {$type=$type."...";}

View File

@ -9,13 +9,13 @@ my $URL_lng = -111.93882;
my $URL_ProID = 23;
my $URL_StatID = "C3430";
my $info = `curl -sm 5 https://www.weatherbug.com/api/observation?lat=$URL_lat&lng=$URL_lng&providerId=$URL_ProID&stationId=$URL_StatID` or die "Error";
my $info = `curl -sm 5 "https://www.weatherbug.com/api/observation?lat=$URL_lat&lng=$URL_lng&providerId=$URL_ProID&stationId=$URL_StatID"` or die "Error";
my $json = decode_json $info or die "Error";
my $loc = %{$json}{"Observation"}->{"Station"}->{"StationName"};
my $temp = %{$json}{"Observation"}->{"Temperature"};
my $loc = %{$json}{"Station"}->{"StationId"};
my $temp = %{$json}{"Observation"}->{"Temperature"};
my $windS = %{$json}{"Observation"}->{"WindSpeedAvg"};
my $windD = %{$json}{"Observation"}->{"WindDirectionAvg"};
print "Unknown:".$temp.":".$windS.":".$windD.":".$loc;
print "?:".$temp.":".$windS.":".$windD.":".$loc;