added silent and timeout flags to curl

This commit is contained in:
bluesaxman 2020-01-21 15:10:25 -07:00
parent afe52b9943
commit 376031ee0e
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ my $URL_lng = -111.93882;
my $URL_ProID = 23;
my $URL_StatID = "C3430";
my $info = `curl 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";

View File

@ -6,7 +6,7 @@ use JSON;
my $URL_lat = 40.4936;
my $URL_lon = -111.9388;
my $info = `curl "https://forecast.weather.gov/MapClick.php?lat=$URL_lat&lon=$URL_lon&unit=0&lg=english&FcstType=json"` or die "Error";
my $info = `curl -sm 5 "https://forecast.weather.gov/MapClick.php?lat=$URL_lat&lon=$URL_lon&unit=0&lg=english&FcstType=json"` or die "Error";
my $json = decode_json $info or die "Error";

View File

@ -3,7 +3,7 @@ use strict;
use warnings;
use JSON;
my $info = `curl wttr.in/bluffdale?format=j1` or die "Error";
my $info = `curl -sm 5 wttr.in/bluffdale?format=j1` or die "Error";
my $json = decode_json $info or die "Error";