Added location to output for better troubleshooting
This commit is contained in:
parent
824ca04b56
commit
f98faab11f
@ -92,5 +92,7 @@ elsif ($type =~ /Sun/) {$type = "";}
|
||||
elsif ($type =~ /Snow/) {$type = "";}
|
||||
else {$type=$type."...";}
|
||||
|
||||
print $type." ".$temp." ".$wdir." ".$wind."mph\n\n";
|
||||
my $loc = substr(($weather[4] or "?????"), 0, 5);
|
||||
|
||||
print $loc." - ".$type." ".$temp." ".$wdir." ".$wind."mph\n\n";
|
||||
print $color."\n";
|
||||
|
@ -13,8 +13,9 @@ my $info = `curl -sm 5 https://www.weatherbug.com/api/observation?lat=$URL_lat&l
|
||||
|
||||
my $json = decode_json $info or die "Error";
|
||||
|
||||
my $loc = %{$json}{"Observation"}->{"Station"}->{"StationName"};
|
||||
my $temp = %{$json}{"Observation"}->{"Temperature"};
|
||||
my $windS = %{$json}{"Observation"}->{"WindSpeedAvg"};
|
||||
my $windD = %{$json}{"Observation"}->{"WindDirectionAvg"};
|
||||
|
||||
print "Unknown:".$temp.":".$windS.":".$windD;
|
||||
print "Unknown:".$temp.":".$windS.":".$windD.":".$loc;
|
||||
|
@ -10,9 +10,10 @@ my $info = `curl -sm 5 "https://forecast.weather.gov/MapClick.php?lat=$URL_lat&l
|
||||
|
||||
my $json = decode_json $info or die "Error";
|
||||
|
||||
my $loc = %{$json}{"location"}->{"areaDescription"};
|
||||
my $temp = %{$json}{"currentobservation"}->{"Temp"};
|
||||
my $windS = %{$json}{"currentobservation"}->{"Winds"};
|
||||
my $windD = %{$json}{"currentobservation"}->{"Windd"};
|
||||
my $desc = %{$json}{"currentobservation"}->{"Weather"};
|
||||
|
||||
print $desc.":".$temp.":".$windS.":".$windD;
|
||||
print $desc.":".$temp.":".$windS.":".$windD.":".$loc;
|
||||
|
@ -7,9 +7,10 @@ my $info = `curl -sm 5 wttr.in/bluffdale?format=j1` or die "Error";
|
||||
|
||||
my $json = decode_json $info or die "Error";
|
||||
|
||||
my $loc = %{$json}{"nearest_area"}->[0]->{"areaName"}->{"value"};
|
||||
my $temp = %{$json}{"current_condition"}->[0]->{"temp_F"};
|
||||
my $windS = %{$json}{"current_condition"}->[0]->{"windspeedMiles"};
|
||||
my $windD = %{$json}{"current_condition"}->[0]->{"winddirDegree"};
|
||||
my $desc = %{$json}{"current_condition"}->[0]->{"weatherDesc"}->[0]->{"value"};
|
||||
|
||||
print $desc.":".$temp.":".$windS.":".$windD;
|
||||
print $desc.":".$temp.":".$windS.":".$windD.":".$loc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user