Made corrections location output
This commit is contained in:
parent
f98faab11f
commit
26e671051b
@ -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."...";}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user